MCPcopy Create free account
hub / github.com/nodejs/node / TestConstruct2

Function TestConstruct2

deps/v8/test/mjsunit/es6/proxies-function.js:293–303  ·  view source on GitHub ↗
(proto, constructTrap, handler)

Source from the content-addressed store, hash-verified

291}
292
293function TestConstruct2(proto, constructTrap, handler) {
294 var f = new Proxy(function(){}, {construct: constructTrap})
295 var o = new f(11, 31)
296 assertEquals(42, o.sum)
297 assertSame(proto, Object.getPrototypeOf(o))
298
299 var f = Object.freeze(new Proxy(function(){}, {construct: constructTrap}))
300 var o = new f(11, 32)
301 assertEquals(43, o.sum)
302 assertSame(proto, Object.getPrototypeOf(o))
303}
304
305TestConstruct(Object.prototype, ReturnNew)
306TestConstruct(prototype, ReturnNewWithProto)

Callers 1

TestConstructFunction · 0.85

Calls 2

assertEqualsFunction · 0.50
assertSameFunction · 0.50

Tested by

no test coverage detected