diff --git a/test/language/module-code/dup-export-decl.js b/test/language/module-code/early-dup-export-decl.js similarity index 100% rename from test/language/module-code/dup-export-decl.js rename to test/language/module-code/early-dup-export-decl.js diff --git a/test/language/module-code/early-dup-export-dflt-id.js b/test/language/module-code/early-dup-export-dflt-id.js new file mode 100644 index 0000000000..a82ae96fe3 --- /dev/null +++ b/test/language/module-code/early-dup-export-dflt-id.js @@ -0,0 +1,15 @@ +// 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-module-semantics-static-semantics-early-errors +es6id: 15.2.1.1 +description: > + It is a Syntax Error if the ExportedNames of ModuleItemList contains any + duplicate entries. +flags: [module] +negative: SyntaxError +---*/ + +var x, y; +export default x; +export { y as default }; diff --git a/test/language/module-code/dup-export-dflt.js b/test/language/module-code/early-dup-export-dflt.js similarity index 100% rename from test/language/module-code/dup-export-dflt.js rename to test/language/module-code/early-dup-export-dflt.js diff --git a/test/language/module-code/dup-export-id-as.js b/test/language/module-code/early-dup-export-id-as.js similarity index 100% rename from test/language/module-code/dup-export-id-as.js rename to test/language/module-code/early-dup-export-id-as.js diff --git a/test/language/module-code/dup-export-id.js b/test/language/module-code/early-dup-export-id.js similarity index 100% rename from test/language/module-code/dup-export-id.js rename to test/language/module-code/early-dup-export-id.js diff --git a/test/language/module-code/dup-lables.js b/test/language/module-code/early-dup-lables.js similarity index 100% rename from test/language/module-code/dup-lables.js rename to test/language/module-code/early-dup-lables.js diff --git a/test/language/module-code/dup-lex.js b/test/language/module-code/early-dup-lex.js similarity index 100% rename from test/language/module-code/dup-lex.js rename to test/language/module-code/early-dup-lex.js diff --git a/test/language/module-code/early-export-global.js b/test/language/module-code/early-export-global.js new file mode 100644 index 0000000000..2e02038bb2 --- /dev/null +++ b/test/language/module-code/early-export-global.js @@ -0,0 +1,15 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-module-semantics-static-semantics-early-errors +es6id: 15.2.1.1 +description: Exporting a global binding +info: > + It is a Syntax Error if any element of the ExportedBindings of + ModuleItemList does not also occur in either the VarDeclaredNames of + ModuleItemList, or the LexicallyDeclaredNames of ModuleItemList. +flags: [module] +negative: SyntaxError +---*/ + +export { Number }; diff --git a/test/language/module-code/export-unresolvable.js b/test/language/module-code/early-export-unresolvable.js similarity index 100% rename from test/language/module-code/export-unresolvable.js rename to test/language/module-code/early-export-unresolvable.js diff --git a/test/language/module-code/early-import-arguments.js b/test/language/module-code/early-import-arguments.js new file mode 100644 index 0000000000..0885a7ee66 --- /dev/null +++ b/test/language/module-code/early-import-arguments.js @@ -0,0 +1,31 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: ImportedBinding is a BindingIdentifier and cannot be "arguments" +esid: sec-imports +info: | + ImportSpecifier : + ImportedBinding + IdentifierName as ImportedBinding + + ImportedBinding : + BindingIdentifier + + 12.1.1 Static Semantics : Early Errors + + BindingIdentifier : Identifier + + - It is a Syntax Error if the code matched by this production is contained + in strict mode code and the StringValue of Identifier is "arguments" or + "eval". +negative: SyntaxError +flags: [module] +---*/ + +// Create an appropriately-named ExportEntry in order to avoid false positives +// (e.g. cases where the implementation does not generate the expected early +// error but does produce a SyntaxError for unresolvable bindings). +var x; +export { x as arguments }; + +import { arguments } from './early-import-arguments.js'; diff --git a/test/language/module-code/early-import-as-arguments.js b/test/language/module-code/early-import-as-arguments.js new file mode 100644 index 0000000000..f5250a38ca --- /dev/null +++ b/test/language/module-code/early-import-as-arguments.js @@ -0,0 +1,31 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: ImportedBinding is a BindingIdentifier and cannot be "arguments" +esid: sec-imports +info: | + ImportSpecifier : + ImportedBinding + IdentifierName as ImportedBinding + + ImportedBinding : + BindingIdentifier + + 12.1.1 Static Semantics : Early Errors + + BindingIdentifier : Identifier + + - It is a Syntax Error if the code matched by this production is contained + in strict mode code and the StringValue of Identifier is "arguments" or + "eval". +negative: SyntaxError +flags: [module] +---*/ + +// Create an appropriately-named ExportEntry in order to avoid false positives +// (e.g. cases where the implementation does not generate the expected early +// error but does produce a SyntaxError for unresolvable bindings). +var x; +export { x }; + +import { x as arguments } from './early-import-as-arguments.js'; diff --git a/test/language/module-code/early-import-as-eval.js b/test/language/module-code/early-import-as-eval.js new file mode 100644 index 0000000000..2b732cebec --- /dev/null +++ b/test/language/module-code/early-import-as-eval.js @@ -0,0 +1,31 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: ImportedBinding is a BindingIdentifier and cannot be "eval" +esid: sec-imports +info: | + ImportSpecifier : + ImportedBinding + IdentifierName as ImportedBinding + + ImportedBinding : + BindingIdentifier + + 12.1.1 Static Semantics : Early Errors + + BindingIdentifier : Identifier + + - It is a Syntax Error if the code matched by this production is contained + in strict mode code and the StringValue of Identifier is "arguments" or + "eval". +negative: SyntaxError +flags: [module] +---*/ + +// Create an appropriately-named ExportEntry in order to avoid false positives +// (e.g. cases where the implementation does not generate the expected early +// error but does produce a SyntaxError for unresolvable bindings). +var x; +export { x }; + +import { x as eval } from './early-import-as-eval.js'; diff --git a/test/language/module-code/early-import-eval.js b/test/language/module-code/early-import-eval.js new file mode 100644 index 0000000000..c8ba3d20f7 --- /dev/null +++ b/test/language/module-code/early-import-eval.js @@ -0,0 +1,31 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: ImportedBinding is a BindingIdentifier and cannot be "eval" +esid: sec-imports +info: | + ImportSpecifier : + ImportedBinding + IdentifierName as ImportedBinding + + ImportedBinding : + BindingIdentifier + + 12.1.1 Static Semantics : Early Errors + + BindingIdentifier : Identifier + + - It is a Syntax Error if the code matched by this production is contained + in strict mode code and the StringValue of Identifier is "arguments" or + "eval". +negative: SyntaxError +flags: [module] +---*/ + +// Create an appropriately-named ExportEntry in order to avoid false positives +// (e.g. cases where the implementation does not generate the expected early +// error but does produce a SyntaxError for unresolvable bindings). +var x; +export { x as eval }; + +import { eval } from './early-import-eval.js'; diff --git a/test/language/module-code/lex-and-var.js b/test/language/module-code/early-lex-and-var.js similarity index 100% rename from test/language/module-code/lex-and-var.js rename to test/language/module-code/early-lex-and-var.js diff --git a/test/language/module-code/new-target.js b/test/language/module-code/early-new-target.js similarity index 100% rename from test/language/module-code/new-target.js rename to test/language/module-code/early-new-target.js diff --git a/test/language/module-code/strict-mode.js b/test/language/module-code/early-strict-mode.js similarity index 100% rename from test/language/module-code/strict-mode.js rename to test/language/module-code/early-strict-mode.js diff --git a/test/language/module-code/super.js b/test/language/module-code/early-super.js similarity index 100% rename from test/language/module-code/super.js rename to test/language/module-code/early-super.js diff --git a/test/language/module-code/undef-break.js b/test/language/module-code/early-undef-break.js similarity index 100% rename from test/language/module-code/undef-break.js rename to test/language/module-code/early-undef-break.js diff --git a/test/language/module-code/undef-continue.js b/test/language/module-code/early-undef-continue.js similarity index 100% rename from test/language/module-code/undef-continue.js rename to test/language/module-code/early-undef-continue.js