tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

10.6-13-a-3.js (678B)


      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-3
      6 description: An indirect 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     var explicit = arguments.callee.caller;
     26     explicit(true);
     27   }
     28 }
     29 
     30 test1();
     31 
     32 assert(called, 'called !== true');
     33 
     34 reportCompare(0, 0);