4 ms·
I hope they keep it in V8, if only for debugging. There are some cases where this is the only practical way to see what is mucking with your object and when.
by dccoolgai 11y ago
I hope they keep it in V8, if only for debugging. There are some cases where this is the only practical way to see what is mucking with your object and when. If they take it out of the spec, it would be nice if they could add it as a method to console or something, at least.
- randomfool 11y agoIsn't it an async callback though? IMHO, it would be much more useful if it were synchronous.
- dccoolgai 11y agoIt is, but in Chrome devtools it shows you the source of the callback in the stack trace.
- stymaar 11y agoFor debugging purpose, that's exactly what Object.watch does (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...) but this is only a SpideyMonkey feature.
- lemevi 11y agoConsider using a `Proxy` object. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- bcherny 11y agomaybe chrome will support this soon...
- AnkhMorporkian 11y agoProxies are brilliant. I used one to create an promise based RPC system that allows you to call any method you want. So before proxies, we used to do it as: await server.rpc.run("methodName", [argumentOne, argumentTwo]) Now, we just do: await server.rpc.methodName(one, two) The proxy traps that method call and returns a promise that runs that on the server. It's very slick and has made our code a lot more readable.