tor-browser

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

named-reassign-fn-name-in-body-in-eval.js (984B)


      1 // |reftest| async
      2 // This file was procedurally generated from the following sources:
      3 // - src/function-forms/reassign-fn-name-in-body-in-eval.case
      4 // - src/function-forms/expr-named/async-func-expr-named-no-strict.template
      5 /*---
      6 description: Reassignment of function name is silently ignored in non-strict mode code. (async function named expression in non-strict mode code)
      7 esid: sec-async-function-definitions
      8 features: [async-functions]
      9 flags: [generated, async, noStrict]
     10 includes: [asyncHelpers.js]
     11 info: |
     12    Async Function Definitions
     13 
     14    AsyncFunctionExpression :
     15      async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
     16 
     17 ---*/
     18 
     19 // increment callCount in case "body"
     20 let callCount = 0;
     21 let ref = async function BindingIdentifier() {
     22  callCount++;
     23  eval("BindingIdentifier = 1");
     24  return BindingIdentifier;
     25 };
     26 
     27 asyncTest(async () => {
     28  assert.sameValue(await ref(), ref);
     29  assert.sameValue(callCount, 1, 'function invoked exactly once');
     30 });