tor-browser

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

name-invoke-fn-no-strict.js (520B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 description: >
      6    In the absence of the "use strict" directive, functions declared as methods
      7    obey "global" ThisMode semantics.
      8 es6id: 14.3.8
      9 flags: [noStrict]
     10 ---*/
     11 
     12 var global = (function() { return this; }());
     13 var thisValue = null;
     14 var method = {
     15  method() {
     16    thisValue = this;
     17  }
     18 }.method;
     19 
     20 method();
     21 
     22 assert.sameValue(thisValue, global);
     23 
     24 reportCompare(0, 0);