yield-as-identifier-in-nested-function.js (534B)
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 es6id: 12.1.1 9 flags: [noStrict] 10 features: [generators] 11 ---*/ 12 13 var result; 14 var g = function*() { 15 function h() { 16 yield = 1; 17 } 18 }; 19 20 result = g().next(); 21 assert.sameValue(result.value, undefined); 22 assert.sameValue(result.done, true); 23 24 reportCompare(0, 0);