| // Copyright (C) 2020 Rick Waldron. All rights reserved. | |
| // This code is governed by the BSD license found in the LICENSE file. | |
| /*--- | |
| path: language/expressions/function/named-no-strict- | |
| name: named function expression in non-strict mode code | |
| esid: sec-function-definitions-runtime-semantics-evaluation | |
| info: | | |
| FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody } | |
| flags: [noStrict] | |
| ---*/ | |
| // increment callCount in case "body" | |
| let callCount = 0; | |
| let ref = function BindingIdentifier() { | |
| /*{ body }*/ | |
| }; | |
| assert.sameValue(ref(), ref); | |
| assert.sameValue(callCount, 1, 'function invoked exactly once'); |