Merge pull request #1831 from leobalter/1829-dyn-import-fixes

[dynamic import] Fix async test to verify completion
This commit is contained in:
Leo Balter 2018-10-05 12:41:12 -04:00 committed by GitHub
commit 00cfe1628c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 4 deletions

View File

@ -24,4 +24,8 @@ features: [dynamic-import]
flags: [async]
---*/
if (true) import(/*{ params }*/);
if (true) import(/*{ params }*/).then(imported => {
/*{ body }*/
}).then($DONE, $DONE).catch($DONE);

View File

@ -34,4 +34,9 @@ info: |
---*/
if (true) import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js');
if (true) import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
assert.sameValue(imported.default(), 1);
assert.sameValue(imported.default, 2);
}).then($DONE, $DONE).catch($DONE);

View File

@ -35,4 +35,16 @@ info: |
---*/
if (true) import('./eval-gtbndng-indirect-update_FIXTURE.js');
if (true) import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
assert.sameValue(imported.x, 1);
// This function is exposed on the global scope (instead of as an exported
// binding) in order to avoid possible false positives from assuming correct
// behavior of the semantics under test.
fnGlobalObject().test262update();
assert.sameValue(imported.x, 2);
}).then($DONE, $DONE).catch($DONE);

View File

@ -22,4 +22,8 @@ info: |
---*/
if (true) import('./dynamic-import-module_FIXTURE.js');
if (true) import('./dynamic-import-module_FIXTURE.js').then(imported => {
assert.sameValue(imported.x, 1);
}).then($DONE, $DONE).catch($DONE);