Closed Bug 1508672 Opened 6 years ago Closed 6 years ago

Enable test262 dynamic module import tests and fix failures

Categories

(Core :: JavaScript Engine, enhancement, P3)

61 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(5 files)

As pointed out in bug 1342012, there are now a bunch of test262 tests for this.
Blocks: 1342012
Assignee: nobody → jcoppeard
Remove the 'skip' keyword for test262 dynamic import tests and add those that fail to jstests.list.
Attachment #9027143 - Flags: review?(jorendorff)
The parser currently accepts |new import()| which is wrong because import() is not a MemberExpression.  The patch fixes this by passing allowCallSyntax into importExpr().
Attachment #9027160 - Flags: review?(jorendorff)
Patch to fix a couple of minor issues in the tests themselves:

 - indirect-resolution-1_FIXTURE.js has a bare import specifier. This should be a relative specifier to find the indirect-resolution-2_FIXTURE.js module.

 - default-property-not-set-own.js is not a module but imports itself as a module and so gets run twice.  When this happens $DONE complains about being called twice.

I also made a pull request for these changes: https://github.com/tc39/test262/pull/1965
Attachment #9027164 - Flags: review?(jorendorff)
The spec says that success and failure actions for dynamic import must happen 'at some future time', but the shell module loader executes them immediately.  This allows a dynamic import to observe a module that is still in the evaluating state, which causes an assertion failure.

The patch uses a promise to defer these actions.
Attachment #9027167 - Flags: review?(jorendorff)
Finally, the shell abortDynamicModuleImport() function used by the shell module loader assumes that only ErrorObjects will be thrown, causing tests that throw other values to fail.  The patch removes this restriction.
Attachment #9027171 - Flags: review?(jorendorff)
Attachment #9027143 - Flags: review?(jorendorff) → review+
Comment on attachment 9027160 [details] [diff] [review]
bug1508672-new-import-syntax-error

Review of attachment 9027160 [details] [diff] [review]:
-----------------------------------------------------------------

Nice!
Attachment #9027160 - Flags: review?(jorendorff) → review+
Attachment #9027164 - Flags: review?(jorendorff) → review+
Attachment #9027167 - Flags: review?(jorendorff) → review+
Comment on attachment 9027171 [details] [diff] [review]
bug1508672-exception-values

Review of attachment 9027171 [details] [diff] [review]:
-----------------------------------------------------------------

You sure make it look easy. :)
Attachment #9027171 - Flags: review?(jorendorff) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/761da392dd7a
Enable passing test262 dynamic import tests r=jorendorff
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ee93898e415
Make |new import()| a syntax error r=jorendorff
https://hg.mozilla.org/integration/mozilla-inbound/rev/93445c302752
Fix some minor test262 issues in dynamic import tests r=jorendorff
https://hg.mozilla.org/integration/mozilla-inbound/rev/46ce47bd3368
Finish dynamic module import at a later time in the shell r=jorendorff
https://hg.mozilla.org/integration/mozilla-inbound/rev/9363b52649ac
Dynamically imported modules can throw any value as an exception r=jorendorff
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: