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