tor-browser

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

S15.3_A3_T2.js (658B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: |
      6    Since when call is used for Function constructor themself new function instance creates
      7    and then first argument(thisArg) should be ignored
      8 es5id: 15.3_A3_T2
      9 description: First argument is string and null
     10 ---*/
     11 
     12 this.color = "red";
     13 var planet = "mars";
     14 
     15 var f = Function.call("blablastring", "return this.color;");
     16 
     17 assert.sameValue(f(), "red", 'f() must return "red"');
     18 
     19 var g = Function.call(null, "return this.planet;");
     20 
     21 assert.sameValue(g(), "mars", 'g() must return "mars"');
     22 
     23 reportCompare(0, 0);