test262/test/annexB/language/eval-code/indirect/global-block-decl-eval-glob...

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-04-18 22:18:34 +02:00
// This file was procedurally generated from the following sources:
2017-03-28 02:49:48 +02:00
// - src/annex-b-fns/eval-global-existing-global-init.case
2016-04-18 22:18:34 +02:00
// - src/annex-b-fns/eval-global/indirect-block.template
/*---
2017-04-12 13:55:17 +02:00
description: Variable binding is left in place by legacy function hoisting (Block statement in eval code containing a function declaration)
2016-04-18 22:18:34 +02:00
esid: sec-web-compat-evaldeclarationinstantiation
flags: [generated, noStrict]
includes: [fnGlobalObject.js, propertyHelper.js]
info: |
2016-04-18 22:18:34 +02:00
B.3.3.3 Changes to EvalDeclarationInstantiation
2016-04-18 22:18:34 +02:00
[...]
i. If varEnvRec is a global Environment Record, then
2017-04-12 13:55:17 +02:00
i. Perform ? varEnvRec.CreateGlobalVarBinding(F, true).
2016-04-18 22:18:34 +02:00
[...]
2016-04-18 22:18:34 +02:00
---*/
Object.defineProperty(fnGlobalObject(), 'f', {
value: 'x',
enumerable: true,
writable: true,
configurable: false
});
(0,eval)(
'var global = fnGlobalObject();\
2017-04-12 13:55:17 +02:00
assert.sameValue(f, "x", "binding is not reinitialized");\
2016-04-18 22:18:34 +02:00
\
2017-09-07 22:53:27 +02:00
verifyProperty(global, "f", {\
enumerable: true,\
writable: true,\
configurable: false\
2017-04-12 13:55:17 +02:00
}, { restore: true });{ function f() { } }'
2016-04-18 22:18:34 +02:00
);
2017-04-12 13:55:17 +02:00
assert.sameValue(typeof f, "function");
verifyProperty(global, "f", {
enumerable: true,
writable: true,
configurable: false
});