generator-invoke-fn-no-strict.js (562B)
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, generator functions declared 7 as methods obey "global" ThisMode semantics. 8 es6id: 14.4.13 9 flags: [noStrict] 10 features: [generators] 11 ---*/ 12 13 var global = (function() { return this; }()); 14 var thisValue = null; 15 var method = { 16 *method() { 17 thisValue = this; 18 } 19 }.method; 20 21 method().next(); 22 23 assert.sameValue(thisValue, global); 24 25 reportCompare(0, 0);