Bug 1892041 - Part 1: Update test262 features. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / annexB / language / eval-code / direct / script-decl-lex-no-collision-in-strict-mode-strict.js
blobda859c843d348dc5f3292b95c62d944dccb2b6f1
1 'use strict';
2 // Copyright (C) 2023 Alexey Shvayka. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-globaldeclarationinstantiation
6 description: No let binding collision with existing var declaration due to strict-mode eval().
7 info: |
8   PerformEval ( x, strictCaller, direct )
10   [...]
11   16. If direct is true, then
12     a. Let lexEnv be NewDeclarativeEnvironment(runningContext's LexicalEnvironment).
13   [...]
14   18. If strictEval is true, set varEnv to lexEnv.
15 flags: [onlyStrict]
16 ---*/
18 eval('if (true) { function test262Fn() {} }');
20 $262.evalScript('let test262Fn = 1;');
22 assert.sameValue(test262Fn, 1);
24 reportCompare(0, 0);