As pointed out by @thg435 the issue was discussed in a narrower scope at Is there an equivalent of the __noSuchMethod__ feature for properties, or a way to implement it in JS? but the answer from there applies here.
An appropriate API for doing this in javascript is in the making, called ECMAScript Harmony Proxies which may have been replaced recently with Direct Proxy. This API is not yet supported cross-platform, but it may work for some platform, such as recent firefox and chrome.