1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/proxy/testDirectProxyHas2.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, the target as the first 1.6 + * argument, and the name of the property as the second argument 1.7 + */ 1.8 +var target = {}; 1.9 +var called = false; 1.10 +var handler = { 1.11 + has: function (target1, name) { 1.12 + assertEq(this, handler); 1.13 + assertEq(target1, target); 1.14 + assertEq(name, 'foo'); 1.15 + called = true; 1.16 + } 1.17 +}; 1.18 +'foo' in new Proxy(target, handler); 1.19 +assertEq(called, true);