| 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/indirect-block.template |
| 4 |
/*--- |
| 5 |
description: Variable binding is set to `undefined` (Block statement in eval code containing a function declaration) |
| 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 |
(0,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 |
});{ function f() { } }' |
| 45 |
); |