Debian Codegraph @

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

raw
1 // |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) error:SyntaxError 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: >
6 WithClause in ImportDeclaration may include line terminators
7 esid: sec-modules
8 info: |
9 ImportDeclaration:
10 import ModuleSpecifier[no LineTerminator here] WithClause;
11
12 WithClause:
13 AttributesKeyword {}
14 AttributesKeyword {WithEntries ,opt}
15
16 WithEntries:
17 AttributeKey : StringLiteral
18 AttributeKey : StringLiteral , WithEntries
19
20 AttributeKey:
21 IdentifierName
22 StringLiteral
23
24 This test uses all four LineFeed characters in order to completely verify the
25 grammar.
26 negative:
27 phase: resolution
28 type: SyntaxError
29 features: [import-attributes, globalThis]
30 flags: [module]
31 ---*/
32
33 $DONOTEVALUATE();
34
35 import "./ensure-linking-error_FIXTURE.js";
36
37 import x from './import-attribute-1_FIXTURE.js' with
38
39 

{
40
41 

test262
42
43 

:
44
45 

''
46
47 

};
48 import './import-attribute-2_FIXTURE.js' with
49
50 

{
51
52 

test262
53
54 

:
55
56 

''
57
58 

};
59 export * from './import-attribute-3_FIXTURE.js' with
60
61 

{
62
63 

test262
64
65 

:
66
67 

''
68
69 

};
70
71 assert.sameValue(x, 262.1);
72 assert.sameValue(globalThis.test262, 262.2);