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