tor-browser

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

global-switch-case-eval-global-init.js (1015B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/annex-b-fns/eval-global-init.case
      3 // - src/annex-b-fns/eval-global/indirect-switch-case.template
      4 /*---
      5 description: Variable binding is initialized to `undefined` in outer scope (Function declaration in the `case` clause of a `switch` statement in eval code)
      6 esid: sec-web-compat-evaldeclarationinstantiation
      7 flags: [generated, noStrict]
      8 includes: [fnGlobalObject.js, propertyHelper.js]
      9 info: |
     10    B.3.3.3 Changes to EvalDeclarationInstantiation
     11 
     12    [...]
     13    i. If varEnvRec is a global Environment Record, then
     14       i. Perform ? varEnvRec.CreateGlobalFunctionBinding(F, undefined, true).
     15    [...]
     16 
     17 ---*/
     18 
     19 (0,eval)(
     20  'var global = fnGlobalObject();\
     21  assert.sameValue(f, undefined, "binding is initialized to `undefined`");\
     22  \
     23  verifyProperty(global, "f", {\
     24    enumerable: true,\
     25    writable: true,\
     26    configurable: true\
     27  });switch (1) {' +
     28  '  case 1:' +
     29  '    function f() {  }' +
     30  '}\
     31  '
     32 );
     33 
     34 reportCompare(0, 0);