named-no-strict-reassign-fn-name-in-body.js (886B)
1 // This file was procedurally generated from the following sources: 2 // - src/function-forms/reassign-fn-name-in-body.case 3 // - src/function-forms/expr-named/gen-func-expr-named-no-strict.template 4 /*--- 5 description: Reassignment of function name is silently ignored in non-strict mode code. (named generator function expression in non-strict mode code) 6 esid: sec-generator-function-definitions-runtime-semantics-evaluation 7 features: [generators] 8 flags: [generated, noStrict] 9 info: | 10 GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } 11 12 ---*/ 13 14 // increment callCount in case "body" 15 let callCount = 0; 16 let ref = function * BindingIdentifier() { 17 callCount++; 18 BindingIdentifier = 1; 19 return BindingIdentifier; 20 }; 21 22 assert.sameValue(ref().next().value, ref); 23 assert.sameValue(callCount, 1, 'function invoked exactly once'); 24 25 reportCompare(0, 0);