tor-browser

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

name.js (1350B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-function-definitions-runtime-semantics-evaluation
      6 description: Assignment of function `name` attribute
      7 info: |
      8    FunctionExpression : function ( FormalParameters ) { FunctionBody }
      9 
     10    1. Let scope be the LexicalEnvironment of the running execution context.
     11    2. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
     12       scope, "").
     13    ...
     14    5. Return closure.
     15 
     16    FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
     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, false).
     23    6. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
     24       funcEnv, name).
     25    ...
     26    10. Return closure.
     27 includes: [propertyHelper.js]
     28 ---*/
     29 
     30 verifyProperty(function() {}, "name", {
     31  value: "", writable: false, enumerable: false, configurable: true
     32 });
     33 
     34 verifyProperty(function func() {}, "name", {
     35  value: "func", writable: false, enumerable: false, configurable: true
     36 });
     37 
     38 reportCompare(0, 0);