mirror of https://github.com/tc39/test262.git
Add tests for position of module declarations
Assert that ImportDeclaration and ExportDeclaration match only the ModuleItem symbol. According to the definition of HostResolveImportedModule, it is acceptable for an implementation to throw a SyntaxError in the event that a requested module can neither be found nor created: > If a Module Record corresponding to the pair referencingModule, > specifier does not exist or cannot be created, an exception must be > thrown. In order to reliably detect a SyntaxError in response to the correct interpretation of the grammar (and not a SyntaxError from an *incorrect* interpretation of the grammar followed by a failure to resolve the requested module), the ModuleSpecifier of ExportDeclarations should describe a valid resource.
This commit is contained in:
parent
7d345fc95b
commit
a6dcd0dcca
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: The `export` declaration may not appear within eval code
|
||||
id: sec-scripts
|
||||
flags: [module]
|
||||
info: |
|
||||
Eval code is the source text supplied to the built-in eval function. More
|
||||
precisely, if the parameter to the built-in eval function is a String, it
|
||||
is treated as an ECMAScript Script. The eval code for a particular
|
||||
invocation of eval is the global code portion of that Script.
|
||||
|
||||
A.5 Scripts and Modules
|
||||
|
||||
Script:
|
||||
ScriptBodyopt
|
||||
|
||||
ScriptBody:
|
||||
StatementList
|
||||
---*/
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('export default null;');
|
||||
});
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: The `import` declaration may not appear within eval code
|
||||
id: sec-scripts
|
||||
flags: [module]
|
||||
info: |
|
||||
Eval code is the source text supplied to the built-in eval function. More
|
||||
precisely, if the parameter to the built-in eval function is a String, it
|
||||
is treated as an ECMAScript Script. The eval code for a particular
|
||||
invocation of eval is the global code portion of that Script.
|
||||
|
||||
A.5 Scripts and Modules
|
||||
|
||||
Script:
|
||||
ScriptBodyopt
|
||||
|
||||
ScriptBody:
|
||||
StatementList
|
||||
---*/
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('import v from "./import.js";');
|
||||
});
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: The `export` declaration may not appear within a ScriptBody
|
||||
id: sec-scripts
|
||||
negative: SyntaxError
|
||||
info: |
|
||||
A.5 Scripts and Modules
|
||||
|
||||
Script:
|
||||
ScriptBodyopt
|
||||
|
||||
ScriptBody:
|
||||
StatementList
|
||||
---*/
|
||||
|
||||
export default null;
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: The `import` declaration may not appear within a ScriptBody
|
||||
id: sec-scripts
|
||||
negative: SyntaxError
|
||||
info: |
|
||||
A.5 Scripts and Modules
|
||||
|
||||
Script:
|
||||
ScriptBodyopt
|
||||
|
||||
ScriptBody:
|
||||
StatementList
|
||||
---*/
|
||||
|
||||
import v from './import.js';
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
() => { export default null; };
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
{ void 0; export default null; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
{ export default null; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
class C { static method() { export default null; } }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
class C { method() { export default null; } }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
class C { static *method() { export default null; } }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
class C { *method() { export default null; } }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(class { static *method() { export default null; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(class { *method() { export default null; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(class { static method() { export default null; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(class { method() { export default null; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
do export default null; while (false)
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (const x = 0; false;)
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (const y in [])
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (let y in [])
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (y in [])
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (var y in [])
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (let x = 0; false;)
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (x = 0; false;)
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (const y of [])
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (let y of [])
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (y of [])
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (var y of [])
|
||||
export default null;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (var x = 0; false;)
|
||||
export default null;
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
function f() { export default null; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(function() { export default null; });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
function* g() { export default null; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(function*() { export default null; });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
if (true) { } else export default null;
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
if (false) export default null;
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
test262: export default null;
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
({ *m() { export default null; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
({ get m() { export default null; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
({ m() { export default null; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
({ set m(x) { export default null; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
switch(0) { case 1: export default null; default: }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
switch(0) { case 1: export default null; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
switch(0) { default: export default null; }
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
try { } catch (err) { } finally {
|
||||
export default null;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
try { } catch (err) {
|
||||
export default null;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
try { } finally {
|
||||
export default null;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
try {
|
||||
export default null;
|
||||
} catch (err) { }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `export` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
while (false) export default null;
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
() => { import v from './decl-pos-import-arrow-function.js'; };
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
{ void 0; import v from './decl-pos-import-block-stmt-list.js'; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
{ import v from './decl-pos-import-block-stmt.js'; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
class C { static method() { import v from './decl-pos-import-class-decl-meth-static.js'; } }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
class C { method() { import v from './decl-pos-import-class-decl-meth.js'; } }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
class C { static *method() { import v from './decl-pos-import-class-decl-method-gen-static.js'; } }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
class C { *method() { import v from './decl-pos-import-class-decl-method-gen.js'; } }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(class { static *method() { import v from './decl-pos-import-class-expr-meth-gen-static.js'; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(class { *method() { import v from './decl-pos-import-class-expr-meth-gen.js'; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(class { static method() { import v from './decl-pos-import-class-expr-meth-static.js'; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(class { method() { import v from './decl-pos-import-class-expr-meth.js'; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
do import v from './decl-pos-import-do-while.js'; while (false)
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (const x = 0; false;)
|
||||
import v from './decl-pos-import-for-const.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (const y in [])
|
||||
import v from './decl-pos-import-for-in-const.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (let y in [])
|
||||
import v from './decl-pos-import-for-in-let.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (y in [])
|
||||
import v from './decl-pos-import-for-in-lhs.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (var y in [])
|
||||
import v from './decl-pos-import-for-in-var.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (let x = 0; false;)
|
||||
import v from './decl-pos-import-for-let.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (x = 0; false;)
|
||||
import v from './decl-pos-import-for-lhs.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (const y of [])
|
||||
import v from './decl-pos-import-for-of-const.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (let y of [])
|
||||
import v from './decl-pos-import-for-of-let.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (y of [])
|
||||
import v from './decl-pos-import-for-of-lhs.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (var y of [])
|
||||
import v from './decl-pos-import-for-of-var.js';
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
for (var x = 0; false;)
|
||||
import v from './decl-pos-import-for-var.js';
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
function f() { import v from './decl-pos-import-function-decl.js'; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(function() { import v from './decl-pos-import-function-expr.js'; });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
function* g() { import v from './decl-pos-import-generator-decl.js'; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
(function*() { import v from './decl-pos-import-generator-expr.js'; });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
if (true) { } else import v from './decl-pos-import-if-else.js';
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
if (false) import v from './decl-pos-import-if-if.js';
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
test262: import v from './decl-pos-import-labeled.js';
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
({ *m() { import v from './decl-pos-import-object-gen-method.js'; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
({ get m() { import v from './decl-pos-import-object-getter.js'; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
({ m() { import v from './decl-pos-import-object-method.js'; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Expression cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
({ set m(x) { import v from './decl-pos-import-object-setter.js'; } });
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
switch(0) { case 1: import v from './decl-pos-import-switch-case-dflt.js'; default: }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
switch(0) { case 1: import v from './decl-pos-import-switch-case.js'; }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
switch(0) { default: import v from './decl-pos-import-switch-dftl.js'; }
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
try { } catch (err) { } finally {
|
||||
import v from './decl-pos-import-try-catch-finally.js';
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
try { } catch (err) {
|
||||
import v from './decl-pos-import-try-catch.js';
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
try { } finally {
|
||||
import v from './decl-pos-import-try-finally.js';
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
try {
|
||||
import v from './decl-pos-import-try-try.js';
|
||||
} catch (err) { }
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Statement cannot contain an `import` declaration
|
||||
id: sec-modules
|
||||
negative: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
||||
while (false) import v from './decl-pos-import-while.js';
|
Loading…
Reference in New Issue