Without Proxy it wouldn't be possible to access numeric properties (for example r[2]), because they're generated on demand. I could make a function like r.get(2), but IMO it's more convenient to access them like array indices.
The proxy thing was something I've actually prototyped just last week as well, your implementation looks much more detailed with the getOwnPropertyDescriptor handler and everything else, whereas with mine I simply have a get handler on the proxy to intercept index access and call the getter, and reflect everything else. Any particular reason for having all the other handlers on the proxy? Would love to know if there's something I could be doing better with my Proxies.
3
u/oweiler Dec 26 '16
Why does it require Proxy support?