RESOLVED FIXED 7924
Cant create inline function using "new Function()" syntax
https://bugs.webkit.org/show_bug.cgi?id=7924
Summary Cant create inline function using "new Function()" syntax
Parag Shah
Reported 2006-03-22 18:18:59 PST
See attached (siimplified) testcase for example. Basically, Safari chokes when trying to assign a new inline function to a variable using "new Function()". The attached testcase creates a dummy object and then attempts to create a "proxy" object or copy of that object by assigning the prototype of the proxied object to the original object (its simpler than it sounds). The workaround is to make the assignment using "function() {}" instead. I.e., this does not work: var proxyCtor = new Function(); This does work: var proxyCtor = function() {}; Both cases work in IEv6 and FFv1.5 (both on win and Mac).
Attachments
Testcase exposing bug in question (1.40 KB, text/html)
2006-03-22 18:20 PST, Parag Shah
no flags
Test ReadOnly attribute (611 bytes, text/html)
2007-10-13 16:25 PDT, Garrett Smith
no flags
Parag Shah
Comment 1 2006-03-22 18:20:29 PST
Created attachment 7243 [details] Testcase exposing bug in question Clicking on the link should alert "doit" twice. Safari only alerts once :(
Garrett Smith
Comment 2 2007-10-13 16:25:14 PDT
Created attachment 16654 [details] Test ReadOnly attribute FIXED. The function instance was given a prototype property. with Function() and new Function(), this property was incorrectly flagged ReadOnly. This has been fixed in Webkit.
David Kilzer (:ddkilzer)
Comment 3 2008-02-22 17:26:23 PST
Both test cases work for me with a local debug build of Webkit r30458.
Note You need to log in before you can comment on or make changes to this bug.