Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-global-init.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/annex-b-fns/eval-global-existing-global-init.case
3 // - src/annex-b-fns/eval-global/direct-switch-dflt.template
4 /*---
5 description: Variable binding is set to `undefined` (Funtion declaration in the `default` clause of a `switch` statement in eval code in the global scope)
6 esid: sec-web-compat-evaldeclarationinstantiation
7 es6id: B.3.3.3
8 flags: [generated, noStrict]
9 includes: [fnGlobalObject.js, propertyHelper.js]
10 info: |
11 B.3.3.3 Changes to EvalDeclarationInstantiation
12
13 [...]
14 i. If varEnvRec is a global Environment Record, then
15 i. Perform ? varEnvRec.CreateGlobalFunctionBinding(F, undefined, true).
16 [...]
17
18 8.1.1.4.18 CreateGlobalFunctionBinding
19
20 [...]
21 5. If existingProp is undefined or existingProp.[[Configurable]] is true,
22 then
23 [...]
24 6. Else,
25 a. Let desc be the PropertyDescriptor{[[Value]]: V }.
26 [...]
27
28 ---*/
29 Object.defineProperty(fnGlobalObject(), 'f', {
30 value: 'x',
31 enumerable: true,
32 writable: true,
33 configurable: false
34 });
35
36 eval(
37 'var global = fnGlobalObject();\
38 assert.sameValue(f, undefined, "binding is initialized to `undefined`");\
39 \
40 verifyProperty(global, "f", {\
41 enumerable: true,\
42 writable: true,\
43 configurable: false\
44 });switch (1) {' +
45 ' default:' +
46 ' function f() { }' +
47 '}\
48 '
49 );