10.6-13-a-2.js (647B)
1 // Copyright (c) 2012 Ecma International. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 es5id: 10.6-13-a-2 6 description: A direct call to arguments.callee.caller should work 7 flags: [noStrict] 8 features: [caller] 9 ---*/ 10 11 var called = false; 12 13 function test1(flag) { 14 if (flag!==true) { 15 test2(); 16 } else { 17 called = true; 18 } 19 } 20 21 function test2() { 22 if(arguments.callee.caller===undefined) { 23 called=true; // Extension not supported - fake it 24 } else { 25 arguments.callee.caller(true); 26 } 27 } 28 29 test1(); 30 31 assert(called, 'called !== true'); 32 33 reportCompare(0, 0);