Editorial: tweak note in FunctionDeclarationInstantiation #2500
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.
I noticed in this thread that FunctionDeclarationInstantiation step 19.a is misleading. It reads
The NOTE is identical to that in step 27.a, from which it was presumably copied:
But the conditions are different, and in a relevant way. Step 19 actually has nothing to do with top-level
var
declarations; rather, it's about where to putvar
declarations arising from sloppy-mode direct calls toeval
in parameter expressions. (Step 27/28 is what governs where to putvar
declarations from the function body.)So the NOTE in step 19 is misleading. I've changed it to talk about
eval
instead.This was introduced in #1046. See also #623 for discussion of whether to keep these branches at all - they're not actually observable to user code (that is, taking the "else" branch in both cases is equivalent to the current state). I think we should probably pursue that eventually, but in the mean time the notes should at least be correct.