It'd be incredibly awesome if __noSuchMethod__ were implemented in WebKit's version of JS.
See <http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object:_noSuchMethod> for details.
<rdar://problem/5818037>
I'm gonna poke this bug and add myself to it. I've been bugging the V8 crowd to add this to their engine: http://code.google.com/p/v8/issues/detail?id=264 so I'll bug you all to add it to Nitro :-). They have a small patch ready and I've tested it successfully, so maybe we can get some friendly competition here :-D. A bit of background: as I stated on the V8 bug report, I'm the guy that originally pestered Brendan Eich back in 2003 to add this capability to Spidermonkey: https://bugzilla.mozilla.org/show_bug.cgi?id=196097 Since he's done that, it's also been included in the Java-based Rhino engine. I've also proposed this extension to the ECMA committee. I'll attach 2 files to this bug report. One is the proposal that my business partner and I made to the ECMA committee to add 'noSuchMethod' to ECMAScript. The other is a pretty comprehensive set of tests, both one from Brendan and a more complex one from my business partner Scott. There is a pretty compelling case for adding this to your interpreter and that is spelled out in the ECMA proposal document. Thanks for your consideration! Cheers, - Bill
Created attachment 38825 [details] A proposal to the ECMA committee to add 'noSuchMethod' support
Created attachment 38826 [details] A testcase demonstrating 'proper' __noSuchMethod__ capability.
This feature now has a 'bottle of your favorite wine' bounty attached to it :-). I've had success with such bribery over on the Mozilla project (and, yes, have paid it off - seriously...) :-). In addition, I'm willing to help in authoring tests, etc. My C skills are very lacking (its been quite a number of years), but I do JS all day long, every day. Having this feature would allow me to significantly reduce my code size and complexity, so I'm very eager to help make this reality :-). Cheers, - Bill
A proposal for "catch-all proxies" has just been posted to the ES Wiki: http://wiki.ecmascript.org/doku.php?id=strawman:proxies
__noSuchMethod__ is an effectively dead extension in spidermonkey, it is not being proposed for standardisation. To quote Brendan: "http://wiki.ecmascript.org/doku.php?id=harmony:proxies is the future"
BTW, http://wiki.ecmascript.org/doku.php?id=harmony:proxies is implemented (useful for spec improvement, necessary by agreement in TC39 -- so a JSC impl would be helpful) for SpiderMonkey, see https://bugzilla.mozilla.org/show_bug.cgi?id=546590 This will probably land soon, and wind up in the next major Firefox release. /be