I'm in the midst of cleaning up the module tonight, beyond the exports you 
mentioned on github, I'm also cleaning up any stuff added the globals. 
While I stuck to only adding utilities to builtin constructors, like 
Object.isPrimitive, the nature of this module is such that the less it 
touches anything global, the better, due to the potential for accidental 
feedback loops in creating interfaces.


With regards to JSON encoding, there actually seems to be a bug with V8's 
JSON encoding where it frequently/always errors with illegal access when 
attempting to stringify proxies/membranes. However, using JSON2 straight 
from Crockford works just fine, just like any regular object. The membrane 
function provided allows you to simply use it to observe without 
modification (the included tracer does this to emit events for all object 
access) or to subtly tweak specific types of access, specific properties, 
or whatever. Basically the only time there is issues is when there's 
implementation bugs in V8 or Spidermonkey, which there are only a handful 
of remaining, and I've done my best to work around in with proxy meta 
handler that is the center of the library.


On Wednesday, May 23, 2012 9:57:14 PM UTC-4, mschwartz wrote:
>
> Thank you very much, your library looks terrific.
>
> One note is that it is not commonJS compliant.
>
> lib/proxy.js ends with:
>
> if (typeof module !== 'undefined')
>   module.exports = proxy;
>
>
> It ideally should also have:
>
> if (typeof exports !== 'undefined')
>   exports = proxy;
>
>
> Also, does it work to JSON encode one of your membrane objects?
>
> On May 23, 2012, at 6:00 PM, Brandon Benvie wrote:
>
> The name of what you're looking for is "membrane". I have a library 
> specifically for helping to make these types of thigns:  
> https://github.com/Benvie/meta-objects
>
> -- 
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>
>
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to