开发者

doesNotUnderstand for JavaScript?

Is there a way to si开发者_运维百科mulate Smalltalk's doesNotUnderstand or Ruby's method_missing in Javascript?


There is no catch-all method defined in the JavaScript standard, but Mozilla implements the non-standard __noSuchMethod__ for SpiderMonkey and Rhino (including Firefox obviously).

You may also be interested in checking out @CMS' answer given to the following Stack Overflow question:

  • Is there an equivalent of the noSuchMethod feature for properties, or a way to implement it in JS?
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜