test262/test/language/module-code/import-assertions/import-assertion-key-string...

38 lines
1013 B
JavaScript
Raw Normal View History

2021-04-30 04:28:12 +02:00
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
WithClause in ImportDeclaration may use a string literal as a key (delimited with U+0022)
2021-04-30 04:28:12 +02:00
esid: sec-modules
info: |
ImportDeclaration:
import ModuleSpecifier[no LineTerminator here] WithClause;
2021-04-30 04:28:12 +02:00
WithClause:
2021-04-30 04:28:12 +02:00
assert {}
assert {WithEntries ,opt}
2021-04-30 04:28:12 +02:00
WithEntries:
AttributeKey : StringLiteral
AttributeKey : StringLiteral , WithEntries
2021-04-30 04:28:12 +02:00
AttributeKey:
2021-04-30 04:28:12 +02:00
IdentifierName
StringLiteral
negative:
phase: resolution
type: SyntaxError
2021-04-30 04:28:12 +02:00
features: [import-assertions, globalThis]
flags: [module]
---*/
$DONOTEVALUATE();
import "../resources/ensure-linking-error_FIXTURE.js";
2021-04-30 04:28:12 +02:00
import x from './import-assertion-1_FIXTURE.js' assert {"test262\u0078":''};
import './import-assertion-2_FIXTURE.js' assert {"test262\u0078":''};
export * from './import-assertion-3_FIXTURE.js' assert {"test262\u0078":''};
assert.sameValue(x, 262.1);