Skip to main content
6 events
when toggle format what by license comment
Jun 1, 2020 at 19:10 comment added yawn @diegocr Me neither, looks like defineProperty directly updates the object (it doesn't look up the prototype chain, maybe a bug?). All other traps seem to work fine, even getOwnProperty etc. You could always money patch defineProperty, or write your other handlers to also look into the object directly.
May 25, 2020 at 18:15 comment added diegocr @yawn indeed, thanks! Although, i am unable to use the defineProperty trap with this hack :-/
Jul 13, 2019 at 3:14 comment added yawn Also I think ctr should be Object.create(Object.getPrototypeOf(t)), otherwise the prototype chain is overwritten.
Jul 13, 2019 at 3:13 comment added yawn Love it, great hack. I'm only interested in this for prototyping anyway, and so I can probably do something crazy like delete the keys on the existing object, assign them to the prototype proxy, and monkey patch Object.keys and friends to lie and include the moved properties in their output.
Jul 13, 2019 at 3:05 vote accept yawn
Jul 12, 2019 at 19:41 history answered Marcus Pope CC BY-SA 4.0