Debian Codegraph @

js/src/tests/test262/language/module-code/import-attributes/import-attribute-empty.js

raw
1 // |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) module -- requires shell-options
2 // Copyright (C) 2021 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: WithClause in ImportDeclaration may be empty
6 esid: sec-modules
7 info: |
8 ImportDeclaration:
9 import ModuleSpecifier[no LineTerminator here] WithClause;
10
11 WithClause:
12 AttributesKeyword {}
13 AttributesKeyword {WithEntries ,opt}
14
15 WithEntries:
16 AttributeKey : StringLiteral
17 AttributeKey : StringLiteral , WithEntries
18
19 AttributeKey:
20 IdentifierName
21 StringLiteral
22 features: [import-attributes, globalThis]
23 flags: [module]
24 ---*/
25
26 import x from './import-attribute-1_FIXTURE.js' with {};
27 import './import-attribute-2_FIXTURE.js' with {};
28 export * from './import-attribute-3_FIXTURE.js' with {};
29
30 assert.sameValue(x, 262.1);
31
32 reportCompare(0, 0);