Polyfilling Object.observe

Oriol _ oriol-bugzilla at hotmail.com
Sat Jul 28 10:56:21 UTC 2018

> Every time I wish I could use `Proxy` in a simple way, there's always some issue with it. For example: https://jsfiddle.net/trusktr/hwfontLc/17

The main problem with that code is that the `prototype` property of a class is read-only, that's why you see no output. Blame classes instead of proxies.
And then inside the proxy traps you should use the target instead of the receiver if you want to avoid infinite recursion.
I have never had issues with proxies.

> So the following is what I'm using
Your function has various problems like assuming that you can define symbol properties in property descriptors and read them later, ignoring the receiver when calling getters and setters, assuming all objects are extensible and all properties are configurable, etc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180728/896af3f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2497 bytes
Desc: pEpkey.asc
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180728/896af3f9/attachment.bin>

More information about the es-discuss mailing list