[Webkit-unassigned] [Bug 138859] New: Duplicate global function declaration does not throw TypeError

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 18 19:10:45 PST 2014


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

            Bug ID: 138859
           Summary: Duplicate global function declaration does not throw
                    TypeError
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Macintosh Intel
                OS: Mac OS X 10.9
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: daejunpark at gmail.com

According to ES5, Section 10.5 Declaration Binding Instantiation, Step 5.e.iv,
http://es5.github.io/#x10.5

a duplicate global function declaration throws a TypeError exception,
when the existing property is not configurable and:
- an accessor descriptor,
- or, not writable,
- or, not enumerable.

For example, the following code is supposed to throw a TypeError exception for each duplicate function declaration, "f0", "f1", "f2", and "f3":

Object.defineProperty(this, "f0", { "get" : undefined, "set" : undefined, "enumerable" : false, "configurable" : false });
eval(" function f0() { return 0; } "); // TypeError

Object.defineProperty(this, "f1", { "value" : 0,      "writable" : false, "enumerable" : false, "configurable" : false });
eval(" function f1() { return 0; } "); // TypeError

Object.defineProperty(this, "f2", { "value" : 0,      "writable" : true,  "enumerable" : false, "configurable" : false });
eval(" function f2() { return 0; } "); // TypeError

Object.defineProperty(this, "f3", { "value" : 0,      "writable" : false, "enumerable" : true,  "configurable" : false });
eval(" function f3() { return 0; } "); // TypeError


However, Safari does not report any exception, while Chrome and Firefox correctly throw the TypeError exceptions.

I've tested this using the Web Inspector console of Safari 7.0.4.

Thanks,
Daejun

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141119/1c5b9a5f/attachment-0002.html>


More information about the webkit-unassigned mailing list