yield-as-identifier-in-nested-function.js (547B)
1 // Copyright (C) 2013 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 `yield` is not a reserved keyword within normal function bodies declared 7 within generator function bodies. 8 features: [generators] 9 es6id: 12.1.1 10 flags: [noStrict] 11 ---*/ 12 13 var result; 14 var obj = { 15 *g() { 16 function h() { 17 yield = 1; 18 } 19 } 20 }; 21 22 result = obj.g().next(); 23 assert.sameValue(result.value, undefined); 24 assert.sameValue(result.done, true); 25 26 reportCompare(0, 0);