Skip to main content

All Questions

Tagged with
0 votes
1 answer
33 views

Mocking an async builder pattern API with proxy

I'm trying to mock knex for testing. Everything seems to work but attaching a proxy to an array as prototype seems to remove the iteratability of arrays. Here is the mock function. Following works ...
srinesha's user avatar
0 votes
0 answers
137 views

Proxy trap that applies to all objects?

I want to write a Proxy trap which applies to all objects. I'm trying to modify the behaviour of all JS objects using the set trap, by replacing a specific value with a predefined getter/setter pair. /...
EnderShadow8's user avatar
1 vote
1 answer
2k views

Proxies: Calling static methods of target's parent when using a proxy object

Really interesting problem here for Javascripters In Javascript, is possible to intercept when getting a property using proxies. Also, with a small hack as shown below, is possible to intercept ...
Ionel Lupu's user avatar
  • 2,762
4 votes
2 answers
3k views

JavaScript pattern for constructing proxy objects, using classical inheritance

Although not finalized, I am experimenting with ES6 Proxies. My goal is to have a constructor function (one that utilizes classical inheritance like the one shown below) for creating proxy objects ...
Mario's user avatar
  • 6,690