3
有没有办法在Javascript中模拟Smalltalk的doesNotUnderstand或Ruby的method_missing?doesNotUnderstand for JavaScript?
有没有办法在Javascript中模拟Smalltalk的doesNotUnderstand或Ruby的method_missing?doesNotUnderstand for JavaScript?
JavaScript标准没有定义全面的方法,但Mozilla为SpiderMonkey和Rhino(显然包括Firefox)实现了非标准的__noSuchMethod__
。
您还可能有兴趣在检查出给予以下堆栈溢出问题@CMS' answer: