mirror of
https://github.com/tc39/test262.git
synced 2025-09-26 19:48:43 +02:00
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.
18 lines
398 B
JavaScript
18 lines
398 B
JavaScript
// 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;
|