Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upGetModuleNamespace has an incorrect assertion #1155
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
allenwb
Mar 27, 2018
Member
I think every place in spec. text that talks about execution values and might be using undefined as a marker for no exception needs to be examined.
I know I never considered the possibility somebody might actually do throw undefined;
|
I think every place in spec. text that talks about execution values and might be using undefined as a marker for no exception needs to be examined. I know I never considered the possibility somebody might actually do |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Mar 27, 2018
Member
In the case you mention [[EvaluationError]] will not be undefined. It will be Completion{[[Type]]: throw, [[Target]]: empty, [[Value]]: undefined}.
|
In the case you mention [[EvaluationError]] will not be undefined. It will be Completion{[[Type]]: throw, [[Target]]: empty, [[Value]]: undefined}. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I share @domenic's reading. Should we just close this issue? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
anba
Apr 4, 2018
Contributor
No. This issue also applies when other things are thrown, e.g. throw new Error;.
import("./a.js"); and import("./b.js"); result in two distinct module declaration and module evaluation passes. After the pass for import("./a.js"); has finished, the module state for the a.js module is [[Status]] = "Evaluated" and [[EvaluationError]] contains an abrupt completion record. So when 15.2.1.16.4.2 ModuleDeclarationEnvironmentSetup for b.js is executed, 15.2.1.16.4.2 step 8.c.i will call 15.2.1.18 GetModuleNamespace for a.js. And then the assertion in 15.2.1.18 step 3 will fire, because [[EvaluationError]] for a.js is not undefined.
|
No. This issue also applies when other things are thrown, e.g.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
GeorgNeis
May 25, 2018
Contributor
Yes, the assertion is incorrect. I believe it's safe to remove it.
|
Yes, the assertion is incorrect. I believe it's safe to remove it. |
ljharb
added
question
spec bug
discussion
completion records
labels
May 25, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Jun 24, 2018
Member
Thanks for explaining. Does anyone want to make a PR to remove the assertion?
|
Thanks for explaining. Does anyone want to make a PR to remove the assertion? |
jorendorff commentedMar 27, 2018
According to this bug:
In https://tc39.github.io/ecma262/#sec-getmodulenamespace, the assertion in step 3
is incorrect.
Test case using the dynamic
import()proposal which results in the same spec assertion.m.js
a.js:
b.js: