[Webkit-unassigned] [Bug 80060] New: hasOwnProperty works inconsistently between WebKit and Firefox

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 1 15:26:21 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=80060

           Summary: hasOwnProperty works inconsistently between WebKit and
                    Firefox
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.7
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: silverma at adobe.com
                CC: silverma at adobe.com


On WebKit nightly and the latest version of Chrome, the following shows two alerts.  On Firefox, it shows one alert.  Which is correct?
NOTE 1 in 15.2.4.5 Object.prototype.hasOwnProperty of the ECMAScript Language Spec says: "this method does not consider objects in the prototype chain", I couldn't figure out if that's relevant.

ECMAScript Language Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

----

<p id="element">Sample Text</p>

<SCRIPT type="text/javascript">

var o = document.getElementById("element");

if(o.hasOwnProperty('style')) {
    alert(o.nodeName + ' has \'style\' as the direct property of the object.');
}
if('style' in o) {
    alert(o.nodeName + ' has \'style\' as a property in the object\'s prototype chain.');
}
</SCRIPT>

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list