tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

named-no-strict-reassign-fn-name-in-body.js (820B)


      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/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  BindingIdentifier = 1;
     18  return BindingIdentifier;
     19 };
     20 
     21 assert.sameValue(ref(), ref);
     22 assert.sameValue(callCount, 1, 'function invoked exactly once');
     23 
     24 reportCompare(0, 0);