-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve robustness of dependency inference
Update the patterns used to detect module dependencies to tolerate string literals which may appear on the same line as module specifiers. Further improve the pattern so that it does not match all U+0022-delimited string literals and so that it does not require a trailing semicolon.
- Loading branch information
1 parent
4770db2
commit 93445b9
Showing
7 changed files
with
39 additions
and
1 deletion.
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
1 change: 1 addition & 0 deletions
1
test/fixtures/fake-test262/test/language/module-code/import-assertion-1_FIXTURE.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 @@ | ||
export default 1; |
1 change: 1 addition & 0 deletions
1
test/fixtures/fake-test262/test/language/module-code/import-assertion-2_FIXTURE.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 @@ | ||
export default 2; |
Empty file.
Empty file.
18 changes: 18 additions & 0 deletions
18
test/fixtures/fake-test262/test/language/module-code/import-assertion-dynamic.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,18 @@ | ||
/*--- | ||
description: Dynamic import assertions | ||
info: | | ||
This test approximates the "import assertions" syntax using code comments in | ||
order to support improvements to ESHost's dependency inferrence logic while | ||
still passing in runtimes which do not yet support the proposed language | ||
extension. | ||
esid: sec-moduleevaluation | ||
flags: [module, async] | ||
---*/ | ||
|
||
Promise.all([ | ||
import('./import-assertion-1_FIXTURE.js'),//, {'':''}) | ||
import("./import-assertion-2_FIXTURE.js"),//, {"":""}) | ||
]).then(function(values) { | ||
assert.sameValue(values[0].default, 1); | ||
assert.sameValue(values[1].default, 2); | ||
}).then($DONE, $DONE); |
18 changes: 18 additions & 0 deletions
18
test/fixtures/fake-test262/test/language/module-code/import-assertion-static.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,18 @@ | ||
/*--- | ||
description: Static import assertions | ||
info: | | ||
This test approximates the "import assertions" syntax using code comments in | ||
order to support improvements to ESHost's dependency inferrence logic while | ||
still passing in runtimes which do not yet support the proposed language | ||
extension. | ||
esid: sec-moduleevaluation | ||
flags: [module] | ||
---*/ | ||
|
||
import one from './import-assertion-1_FIXTURE.js'// assert {'':''}; | ||
import two from "./import-assertion-2_FIXTURE.js"// assert {"":""}; | ||
import './import-assertion-3_FIXTURE.js'// assert {'':''}; | ||
import "./import-assertion-4_FIXTURE.js"// assert {"":""}; | ||
|
||
assert.sameValue(one, 1); | ||
assert.sameValue(two, 2); |