tor-browser

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

name.js (1425B)


      1 // Copyright (C) 2019 André Bargull. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-asyncgenerator-definitions-evaluation
      6 description: Assignment of function `name` attribute
      7 info: |
      8    AsyncGeneratorExpression : async function * ( FormalParameters ) { AsyncGeneratorBody }
      9 
     10    1. Let scope be the LexicalEnvironment of the running execution context.
     11    2. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
     12       AsyncGeneratorBody, scope, "").
     13    ...
     14    6. Return closure.
     15 
     16    AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
     17 
     18    1. Let scope be the running execution context's LexicalEnvironment.
     19    2. Let funcEnv be ! NewDeclarativeEnvironment(scope).
     20    3. Let envRec be funcEnv's EnvironmentRecord.
     21    4. Let name be StringValue of BindingIdentifier.
     22    5. Perform ! envRec.CreateImmutableBinding(name).
     23    6. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
     24       AsyncGeneratorBody, funcEnv, name).
     25    ...
     26    11. Return closure.
     27 includes: [propertyHelper.js]
     28 ---*/
     29 
     30 verifyProperty(async function*() {}, "name", {
     31  value: "", writable: false, enumerable: false, configurable: true
     32 });
     33 
     34 verifyProperty(async function* func() {}, "name", {
     35  value: "func", writable: false, enumerable: false, configurable: true
     36 });
     37 
     38 reportCompare(0, 0);