Skip to content

Commit a419ce7

Browse files
Update tests to post-consensus behavior
1 parent a0bde0e commit a419ce7

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

test/language/module-code/ambiguous-export-bindings/import-and-export-propagates-binding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ info: |
3131
1. Let ie be the element of importEntries whose [[LocalName]] is ee.[[LocalName]].
3232
2. If ie.[[ImportName]] is namespace-object, then
3333
a. NOTE: This is a re-export of an imported module namespace object.
34-
b. Append ee to localExportEntries.
34+
b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries.
3535
3. Else,
3636
a. NOTE: This is a re-export of a single name.
3737
b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]],
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ info: |
1818
Table 59 (Informative): Export Forms Mappings to ExportEntry Records
1919
2020
Export Statement Form [[ExportName]] [[ModuleRequest]] [[ImportName]] [[LocalName]]
21-
export {x}; "x" null null "x"
2221
export * as ns from "mod"; "ns" "mod" all null
2322
2423
16.2.1.7.1 ParseModule ( sourceText, realm, hostDefined )
@@ -31,7 +30,7 @@ info: |
3130
1. Let ie be the element of importEntries whose [[LocalName]] is ee.[[LocalName]].
3231
2. If ie.[[ImportName]] is namespace-object, then
3332
a. NOTE: This is a re-export of an imported module namespace object.
34-
b. Append ee to localExportEntries.
33+
b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries.
3534
3. Else,
3635
a. NOTE: This is a re-export of a single name.
3736
b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]],
@@ -69,15 +68,12 @@ info: |
6968
not the same Module Record, return ~ambiguous~.
7069
3. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]],
7170
return ~ambiguous~.
72-
negative:
73-
phase: resolution
74-
type: SyntaxError
7571
flags: [module]
7672
---*/
7773

78-
$DONOTEVALUATE();
79-
8074
export * from "./namespace-export-star-as-from-1_FIXTURE.js";
8175
export * from "./namespace-import-star-as-and-export-1_FIXTURE.js";
8276

8377
import { foo } from './namespace-ambiguous-if-import-star-as-and-export.js';
78+
79+
assert.sameValue(typeof foo, 'object');

test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ info: |
3131
1. Let ie be the element of importEntries whose [[LocalName]] is ee.[[LocalName]].
3232
2. If ie.[[ImportName]] is namespace-object, then
3333
a. NOTE: This is a re-export of an imported module namespace object.
34-
b. Append ee to localExportEntries.
34+
b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries.
3535
3. Else,
3636
a. NOTE: This is a re-export of a single name.
3737
b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]],
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ info: |
1818
Table 59 (Informative): Export Forms Mappings to ExportEntry Records
1919
2020
Export Statement Form [[ExportName]] [[ModuleRequest]] [[ImportName]] [[LocalName]]
21-
export {x}; "x" null null "x"
2221
export * as ns from "mod"; "ns" "mod" all null
2322
2423
16.2.1.7.1 ParseModule ( sourceText, realm, hostDefined )
@@ -31,7 +30,7 @@ info: |
3130
1. Let ie be the element of importEntries whose [[LocalName]] is ee.[[LocalName]].
3231
2. If ie.[[ImportName]] is namespace-object, then
3332
a. NOTE: This is a re-export of an imported module namespace object.
34-
b. Append ee to localExportEntries.
33+
b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries.
3534
3. Else,
3635
a. NOTE: This is a re-export of a single name.
3736
b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]],
@@ -69,15 +68,12 @@ info: |
6968
not the same Module Record, return ~ambiguous~.
7069
3. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]],
7170
return ~ambiguous~.
72-
negative:
73-
phase: resolution
74-
type: SyntaxError
7571
flags: [module]
7672
---*/
7773

78-
$DONOTEVALUATE();
79-
8074
export * from "./namespace-import-star-as-and-export-1_FIXTURE.js";
8175
export * from "./namespace-import-star-as-and-export-2_FIXTURE.js";
8276

8377
import { foo } from './namespace-ambiguous-if-import-star-as-and-export.js';
78+
79+
assert.sameValue(typeof foo, 'object');

0 commit comments

Comments
 (0)