Closed Bug 350655 Opened 18 years ago Closed 18 years ago

Adding properties to Function prototype fails in chrome

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 300079

People

(Reporter: skrulx, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060731 Ubuntu/dapper-security Firefox/1.5.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060731 Ubuntu/dapper-security Firefox/1.5.0.5

The is similar to bug 344052 but happens only in chrome.  When this script is run in a XUL page:

Function.prototype.foo = function() { alert("foo"); };
var f = function() { };
f.foo();

...the last statement will raise the error "f.foo is not a function".  Note that:

var f = new Function();
f.foo();

..does work.  Also note that all of this works fine in a web page as well as in xpcshell.


Reproducible: Always
Gah, I meant to say that is similar to bug 343966, not bug 344052.
I'll update the summary of bug 300079 to make it more obviously the dup target.

/be

*** This bug has been marked as a duplicate of 300079 ***
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.