开发者

doesNotUnderstand for JavaScript?

开发者 https://www.devze.com 2023-01-20 11:10 出处:网络
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

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

精彩评论

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