Refactor module implementation some more
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(4 files)
Following tidyup work in bug 1778076, here are a few minor refactorings to make the module code simpler and easier to follow.
Assignee | ||
Comment 1•2 years ago
|
||
It's no longer necessary to create an array or list object to hold these. We
can use a vector instead.
Assignee | ||
Comment 2•2 years ago
|
||
This just moves these methods to a different source file. They belong with the
other implementation of the other spec methods and this also permits the next
refactoring.
Depends on D151382
Assignee | ||
Comment 3•2 years ago
|
||
We can just call the function directly now which is simpler and removes
duplication.
I've preserved the existing (questionable) behaviour here and kept the
MOZ_ALWAYS_TRUE. According to the spec this should be inside
ExecuteAsyncModule, however our implementation can fail for reasons that are
not addressed by the spec (e.g. OOM) so we probably need to handle this
somehow.
Depends on D151383
Assignee | ||
Comment 4•2 years ago
|
||
The isAsync method is a little confusing because we also have
isAsyncEvaluating, which is different in important ways. It also doesn't match
the spec which uses hasTLA for this. I find the spec steps easier to follow
with the even more explict 'hasTopLevelAwait' name.
I'm happy to also rename isAsync in the front end too if you think it's a good
idea.
Depends on D151384
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f2c78e0c8f3b
https://hg.mozilla.org/mozilla-central/rev/5c39c8787b24
https://hg.mozilla.org/mozilla-central/rev/647230a3b525
https://hg.mozilla.org/mozilla-central/rev/628666fe24fb
Description
•