My ECMAScript 7 wishlist

Brendan Eich brendan at mozilla.org
Thu Sep 25 17:38:51 PDT 2014


On Sep 25, 2014, at 7:56 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
> 
> SpiderMonkey used to support __noSuchMethod__, I believe.

I implemented __noSuchMethod__ long ago, for the TIBET folks (Smalltalk style JS framework; they wanted a doesNotUnderstand analogue).

Please note well the difference between __noSuchMethod__ and anything like __noSuchProperty__. Even ignoring JITs, back in the interpreter only days, I could justify nSM because it was called on a slow path, when the only outcome without it was a guaranteed "obj.foo is not callable" or worse, "obj.foo is not defined" error.

IOW nSM only kicked in when evaluating

obj.foo(args)

Not just

obj.foo

Any nSP of the kind we seem to be discussing would need to fail fast, on evaluation of the dot expression. That is a fast path.

/be


More information about the es-discuss mailing list