tor-browser

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

named-strict-error-reassign-fn-name-in-body-in-arrow-strict.js (881B)


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