tor-browser

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

switch-case-global-existing-block-fn-no-init.js (814B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/annex-b-fns/global-existing-block-fn-no-init.case
      3 // - src/annex-b-fns/global/switch-case.template
      4 /*---
      5 description: Does not re-initialize binding created by similar forms (Function declaration in the `case` clause of a `switch` statement in the global scope)
      6 esid: sec-web-compat-globaldeclarationinstantiation
      7 flags: [generated, noStrict]
      8 info: |
      9    B.3.3.2 Changes to GlobalDeclarationInstantiation
     10 
     11    [...]
     12    b. If declaredFunctionOrVarNames does not contain F, then
     13       i. Perform ? envRec.CreateGlobalFunctionBinding(F, undefined, false).
     14       ii. Append F to declaredFunctionOrVarNames.
     15 ---*/
     16 assert.sameValue(f, undefined);
     17 
     18 {
     19  function f() {}
     20 }
     21 
     22 switch (1) {
     23  case 1:
     24    function f() {  }
     25 }
     26 
     27 reportCompare(0, 0);