diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-inner-block-var-declaration-after.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-inner-block-var-declaration-after.template new file mode 100644 index 0000000000000000000000000000000000000000..82a470b70a430f07fb2a8fe6f69737cfdb0476b1 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-inner-block-var-declaration-after.template @@ -0,0 +1,36 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-2-to- +name: VariableDeclaration in a BlockStatement inside a BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. + + Static Semantics: VarDeclaredNames + + Block : { } + + 1. Return a new empty List. + + StatementList : StatementList StatementListItem + + 1. Let names be VarDeclaredNames of StatementList. + 2. Append to names the elements of the VarDeclaredNames of StatementListItem. + 3. Return names. + + StatementListItem : Declaration + + 1. Return a new empty List. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +{ /*{ body }*/ { var f; } } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-inner-block-var-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-inner-block-var-declaration.template new file mode 100644 index 0000000000000000000000000000000000000000..1ded0f4e085361aeda413ec38e50f9d065cbcdce --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-inner-block-var-declaration.template @@ -0,0 +1,36 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-to- +name: VariableDeclaration in a BlockStatement inside a BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. + + Static Semantics: VarDeclaredNames + + Block : { } + + 1. Return a new empty List. + + StatementList : StatementList StatementListItem + + 1. Let names be VarDeclaredNames of StatementList. + 2. Append to names the elements of the VarDeclaredNames of StatementListItem. + 3. Return names. + + StatementListItem : Declaration + + 1. Return a new empty List. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +{ { var f; } /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-var-declaration-after.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-var-declaration-after.template new file mode 100644 index 0000000000000000000000000000000000000000..b6d1d6e75c477f9c43b6cd41c9411cf27afcb47d --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-var-declaration-after.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/var-declaration-attempt-2-to- +name: VariableDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +{ /*{ body }*/; var f; } diff --git a/src/declarations/redeclare-allow-sloppy-function/fn-block-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare-allow-sloppy-function/fn-block-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000000000000000000000000000000000..aeeb8e453706b867d8b934e022feaedc7ffe71e3 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/fn-block-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,22 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/fn-scope-var-declaration-attempt-to- +name: VariableDeclaration in BlockStatement inside a function +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +function x() { + { /*{ body }*/; var f; } +} diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-inner-block-var-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-inner-block-var-declaration.template new file mode 100644 index 0000000000000000000000000000000000000000..c30b81633d64d73e2054d382d299199f71f8b16e --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-inner-block-var-declaration.template @@ -0,0 +1,31 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-to- +name: VariableDeclaration in a BlockStatement inside a BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. + + Static Semantics: VarDeclaredNames + + Block : { } + + 1. Return a new empty List. + + StatementList : StatementList StatementListItem + + 1. Let names be VarDeclaredNames of StatementList. + 2. Append to names the elements of the VarDeclaredNames of StatementListItem. + 3. Return names. + + StatementListItem : Declaration + + 1. Return a new empty List. +---*/ + +{ { var f; } /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/fn-block-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare-allow-var/fn-block-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000000000000000000000000000000000..d3737a09c5a299773cf9dc13ae7dad86266f5170 --- /dev/null +++ b/src/declarations/redeclare-allow-var/fn-block-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/fn-scope-var-declaration-attempt-to- +name: VariableDeclaration in BlockStatement inside a function +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +---*/ + +function x() { + { var f; /*{ body }*/ } +} diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-inner-block-var-declaration-after.template b/src/declarations/redeclare/block-attempt-to-redeclare-inner-block-var-declaration-after.template new file mode 100644 index 0000000000000000000000000000000000000000..5ac1cdae648a31bf3f4a5513c82798c10b652104 --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-inner-block-var-declaration-after.template @@ -0,0 +1,36 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-2-to- +name: VariableDeclaration in a BlockStatement inside a BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. + + Static Semantics: VarDeclaredNames + + Block : { } + + 1. Return a new empty List. + + StatementList : StatementList StatementListItem + + 1. Let names be VarDeclaredNames of StatementList. + 2. Append to names the elements of the VarDeclaredNames of StatementListItem. + 3. Return names. + + StatementListItem : Declaration + + 1. Return a new empty List. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +{ /*{ body }*/; { var f; } } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-inner-block-var-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-inner-block-var-declaration.template new file mode 100644 index 0000000000000000000000000000000000000000..710a2cc717143be5c690ebcf9f2e5347d5b6528c --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-inner-block-var-declaration.template @@ -0,0 +1,36 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-to- +name: VariableDeclaration in a BlockStatement inside a BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. + + Static Semantics: VarDeclaredNames + + Block : { } + + 1. Return a new empty List. + + StatementList : StatementList StatementListItem + + 1. Let names be VarDeclaredNames of StatementList. + 2. Append to names the elements of the VarDeclaredNames of StatementListItem. + 3. Return names. + + StatementListItem : Declaration + + 1. Return a new empty List. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +{ { var f; } /*{ body }*/; } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-var-declaration-after.template b/src/declarations/redeclare/block-attempt-to-redeclare-var-declaration-after.template new file mode 100644 index 0000000000000000000000000000000000000000..b6d1d6e75c477f9c43b6cd41c9411cf27afcb47d --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-var-declaration-after.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/var-declaration-attempt-2-to- +name: VariableDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +{ /*{ body }*/; var f; } diff --git a/src/declarations/redeclare/fn-block-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare/fn-block-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000000000000000000000000000000000..aeeb8e453706b867d8b934e022feaedc7ffe71e3 --- /dev/null +++ b/src/declarations/redeclare/fn-block-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,22 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/fn-scope-var-declaration-attempt-to- +name: VariableDeclaration in BlockStatement inside a function +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +function x() { + { /*{ body }*/; var f; } +} diff --git a/test/annexB/language/statements/for-in/bare-initializer.js b/test/annexB/language/statements/for-in/bare-initializer.js index 9ff65b270a9b4b66d7b8f8db0dc667769c4cbaa3..fd9d060fa436cbe9879602a6d6e88e29acd4fc16 100644 --- a/test/annexB/language/statements/for-in/bare-initializer.js +++ b/test/annexB/language/statements/for-in/bare-initializer.js @@ -11,6 +11,5 @@ negative: $DONOTEVALUATE(); var a; -throw NotEarlyError; -for (a = 0 in {}); +for (a = 0 in {}); diff --git a/test/annexB/language/statements/for-in/const-initializer.js b/test/annexB/language/statements/for-in/const-initializer.js index c73605beea2a2572dd196446bba098f423a86187..2ecfcad11ccdf5506c6fb7f90c1b8f1e4cac729b 100644 --- a/test/annexB/language/statements/for-in/const-initializer.js +++ b/test/annexB/language/statements/for-in/const-initializer.js @@ -10,6 +10,6 @@ negative: ---*/ $DONOTEVALUATE(); -throw NotEarlyError; + for (const a = 0 in {}); diff --git a/test/annexB/language/statements/for-in/let-initializer.js b/test/annexB/language/statements/for-in/let-initializer.js index 06415a7f992a20bdb654517c48d91a78e2931332..edd4e508d0ce1adc1084c9014efee4d9f44384eb 100644 --- a/test/annexB/language/statements/for-in/let-initializer.js +++ b/test/annexB/language/statements/for-in/let-initializer.js @@ -10,6 +10,6 @@ negative: ---*/ $DONOTEVALUATE(); -throw NotEarlyError; + for (let a = 0 in {}); diff --git a/test/annexB/language/statements/for-in/strict-initializer.js b/test/annexB/language/statements/for-in/strict-initializer.js index dec0523c575eba8d72831df87341cd9cd168c5d3..f81e59f7cda2cee2d23e9fa91336785e1ba38161 100644 --- a/test/annexB/language/statements/for-in/strict-initializer.js +++ b/test/annexB/language/statements/for-in/strict-initializer.js @@ -11,6 +11,5 @@ flags: [onlyStrict] ---*/ $DONOTEVALUATE(); -throw NotEarlyError; -for (var a = 0 in {}); +for (var a = 0 in {}); diff --git a/test/annexB/language/statements/for-in/var-arraybindingpattern-initializer.js b/test/annexB/language/statements/for-in/var-arraybindingpattern-initializer.js index ac5ca2a8a39f4e1fbc649b6e571faf2a921d0fa8..8682e070035a5b2aa0225141961a88e541630f21 100644 --- a/test/annexB/language/statements/for-in/var-arraybindingpattern-initializer.js +++ b/test/annexB/language/statements/for-in/var-arraybindingpattern-initializer.js @@ -10,6 +10,5 @@ negative: ---*/ $DONOTEVALUATE(); -throw NotEarlyError; -for (var [a] = 0 in {}); +for (var [a] = 0 in {}); diff --git a/test/annexB/language/statements/for-in/var-objectbindingpattern-initializer.js b/test/annexB/language/statements/for-in/var-objectbindingpattern-initializer.js index 91fd1e78ad52f0e242139a86dd643de5fb0a0512..7c156c7e0cf44e8607a6f60f57483793ad3e8344 100644 --- a/test/annexB/language/statements/for-in/var-objectbindingpattern-initializer.js +++ b/test/annexB/language/statements/for-in/var-objectbindingpattern-initializer.js @@ -10,6 +10,6 @@ negative: ---*/ $DONOTEVALUATE(); -throw NotEarlyError; + for (var {a} = 0 in {}); diff --git a/test/language/statements/let/syntax/attempt-to-redeclare-let-binding-with-function-declaration.js b/test/language/statements/let/syntax/attempt-to-redeclare-let-binding-with-function-declaration.js deleted file mode 100644 index 51a0816b715072db4657f398e89726975d7acac6..0000000000000000000000000000000000000000 --- a/test/language/statements/let/syntax/attempt-to-redeclare-let-binding-with-function-declaration.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2011 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: B.3.3 -description: > - redeclaration within block: - attempt to redeclare let binding with function declaration -negative: - phase: parse - type: SyntaxError ----*/ - -$DONOTEVALUATE(); -{ let f; function f() {} } diff --git a/test/language/statements/let/syntax/attempt-to-redeclare-let-binding-with-var.js b/test/language/statements/let/syntax/attempt-to-redeclare-let-binding-with-var.js deleted file mode 100644 index 2f9d74e6e71d36ec29c988a8d8863ca60f0dd00d..0000000000000000000000000000000000000000 --- a/test/language/statements/let/syntax/attempt-to-redeclare-let-binding-with-var.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2011 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: B.3.3 -description: > - redeclaration within block: - attempt to redeclare let binding with var -negative: - phase: parse - type: SyntaxError ----*/ - -$DONOTEVALUATE(); -{ let f; var f; } -