blob: 41d413068ed0fce2221b8760d0d11d916a4c0383 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-globaldeclarationinstantiation
es6id: 15.1.8
description: Let binding collision with existing var declaration
info: |
[...]
5. For each name in lexNames, do
a. If envRec.HasVarDeclaration(name) is true, throw a SyntaxError
exception.
---*/
var test262Var;
function test262Fn() {}
assert.throws(SyntaxError, function() {
$262.evalScript('var x; let test262Var;');
}, 'variable');
assert.throws(ReferenceError, function() {
x;
}, 'no bindings created (script shadowing variable)');
assert.throws(SyntaxError, function() {
$262.evalScript('var x; let test262Fn;');
}, 'function');
assert.throws(ReferenceError, function() {
x;
}, 'no bindings created (script shadowing function)');
reportCompare(0, 0);
|