Add tests for early errors in SwithStatement

This commit is contained in:
Mike Pennisi 2016-06-30 09:00:54 -04:00
parent 843d14ec48
commit b0072ca1b5
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,20 @@
// 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-switch-statement-static-semantics-early-errors
es6id: 13.12.1
description: Syntax error from duplicate lexical variables
info: >
It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any
duplicate entries.
negative: SyntaxError
features: [let, const]
---*/
switch (0) {
case 1:
let test262id;
break;
default:
const test262id = null;
}

View File

@ -0,0 +1,22 @@
// 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-switch-statement-static-semantics-early-errors
es6id: 13.12.1
description: >
Syntax error from collisions between lexical variables and var-declarared
variables
info: >
It is a Syntax Error if any element of the LexicallyDeclaredNames of
CaseClauses also occurs in the VarDeclaredNames of CaseClauses.
negative: SyntaxError
features: [let]
---*/
switch (0) {
case 1:
var test262id;
break;
default:
let test262id;
}