Closed Bug 618702 Opened 14 years ago Closed 14 years ago

__noSuchMethod__ fails with apply, call

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: rcampbell, Unassigned)

References

Details

testcase:

Open a web console in the browser.

In the JSTerm enter:

var a = { b: "hi", __noSuchMethod__: function() { return a; } };

a.d.apply(a, []);

receive:

TypeError: a.d is undefined

This works if we just invoke a.d() by itself.
should be easy to add that as a test case to:

http://mxr.mozilla.org/mozilla-central/source/js/src/tests/js1_5/extensions/no-such-method.js

or split off a separate test.
OS: Mac OS X → All
Hardware: x86 → All
build rev: http://hg.mozilla.org/mozilla-central/rev/e42d81b3e0cc

Mac OS X 10.6.5, but I expect this is cross platform.
(In reply to comment #0)
> a.d.apply(a, []);

a.d isn't being called directly here, so __noSuchMethod__ can't be invoked. To have it behave you want, we'd need a catchall getter (bug 312116) on "a" that returned a callable function. I don't think we can reasonably expect __noSuchMethod__ to work this way.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.