Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #27034 - CYBAI:fix-nested-modules, r=Manishearth
Fix nested modules while imported under more than 3 levels This is kind of workaround to fix the issue but #26903 should provide much better solution to remove the checking. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27029 - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
- Loading branch information
Showing
11 changed files
with
126 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports-a.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import { b } from "./nested-imports-b.js"; |
2 changes: 2 additions & 0 deletions
2
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports-b.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { c } from "./nested-imports-c.js"; | ||
export const b = "b"; |
2 changes: 2 additions & 0 deletions
2
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports-c.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { d } from "./nested-imports-d.js"; | ||
export const c = "c"; |
3 changes: 3 additions & 0 deletions
3
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports-d.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { e } from "./nested-imports-e.js"; | ||
import "./resources/delayed-modulescript.py"; | ||
export const d = "d"; |
2 changes: 2 additions & 0 deletions
2
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports-e.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { f } from "./nested-imports-f.js"; | ||
export const e = "e"; |
2 changes: 2 additions & 0 deletions
2
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports-f.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { g } from "./nested-imports-g.js"; | ||
export const f = "f"; |
2 changes: 2 additions & 0 deletions
2
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports-g.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { h } from "./nested-imports-h.js"; | ||
export const g = "g"; |
2 changes: 2 additions & 0 deletions
2
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports-h.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { c } from "./nested-imports-c.js"; | ||
export const h = "h"; |
29 changes: 29 additions & 0 deletions
29
...b-platform-tests/html/semantics/scripting-1/the-script-element/module/nested-imports.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<title>Test imports under more than 3 levels in different modules</title> | ||
|
||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
setup({ allow_uncaught_exception: true }); | ||
|
||
window.log = []; | ||
|
||
const test_load = async_test("should load all modules successfully"); | ||
window.addEventListener( | ||
"load", | ||
test_load.step_func_done((ev) => { | ||
assert_equals(log.length, 2); | ||
|
||
assert_equals(log[0], 1); | ||
assert_equals(log[1], 2); | ||
}) | ||
); | ||
|
||
function unreachable() { | ||
log.push("unexpected"); | ||
} | ||
</script> | ||
<script type="module" src="./nested-imports-a.js" onerror="unreachable()" | ||
onload="log.push(1)"></script> | ||
<script type="module" src="./nested-imports-e.js" onerror="unreachable()" | ||
onload="log.push(2)"></script> |