views:

96

answers:

1

Does JavaScript have the equivalent of Python's __getattribute__? In the sense that I'd like an object, a, for which a reference to a property x is equivalent to a.__get__('x'). Trying to get this to work in V8. Possible?

Example: an object which makes REST-ful calls:

RESTful("some-url").foo({x:1}) => response of call to "some-url/foo?x=1"
+1  A: 

It is not possible for properties, though there is a non-standard way (__noSuchMethod__) for methods which is only available for Firefox.

Anurag
[ES-Harmony Proxies](http://stackoverflow.com/questions/2266789/is-there-an-equivalent-of-the-nosuchmethod-feature-for-properties-or-a-way-t/3757676#3757676) to the rescue :)
CMS