Skip to content
Advertisement

Tag: es6-proxy

Weird issue about JavaScript Proxy and getter functions

The two test cases blow both pass. I simply don’t understand the behavior. It seems that JavaScript Proxy cannot trap property getting inside a getter function. Answer You’re missing the receiver of the property access. The property might be defined on a different object than it is accessed on, and your Reflect.get call needs to take that into account. In

Advertisement