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