ModuleEvaluation should return undefined #6272
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Picking up on discussion in #6266 this reverts an unintended side-effect of #6171
The successful completion value of a module is
undefined
- this was not tested and the change in #6171 had resulted in it being{done : true}
instead.With this change that is reverted additionally a crude test is added - every time a root module is evaluated in ch the completion value is checked to confirm that it is
undefined
- this would make every single module test fail if this error was ever re-introduced.I note the discussion in #6266 was sparked by a desire for the return value to be the result of the last statement in the module - like with a script - this change will not do that as:
a) it seems that was not done before
b) that would be very complex and
c) that is not per specification see https://tc39.es/ecma262/#sec-moduleevaluation