1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/proxy/testDirectProxyGetOwnPropertyNames2.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +/* 1.5 + * Call the trap with the handler as the this value, and the target as the first 1.6 + * argument 1.7 + */ 1.8 +var target = {}; 1.9 +var called = false; 1.10 +var handler = { 1.11 + getOwnPropertyNames: function (target1) { 1.12 + assertEq(this, handler); 1.13 + assertEq(target1, target); 1.14 + called = true; 1.15 + return []; 1.16 + } 1.17 +}; 1.18 +assertEq(Object.getOwnPropertyNames(new Proxy(target, handler)).length, 0); 1.19 +assertEq(called, true);