[_objectSpread2] Do not use hoisted var from prev iteration #10180
+13
−7
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.
This was an error introduced in https://github.com/babel/babel/pull/10171/files.
The helper got the keys from
source
, which was defined at the previous iteration.Also, I added a test faking an old env by deleting
Object.getOwnPropertyDescriptors
😎If I had used
let
this would not have happened. Also, this is what happens when I merge a PR without waiting for the usual two ✔️; this bug could have been caught by more eyes looking at it.@JordanProtin Could you check that if you update
_objectSpread2
like this in@babel/helpers
,@babel/runtime
,@babel/runtime-corejs2
and/or@babel/runtime-corejs3
in yournode_modules
(there could be multiple copied of each package) it works? I can reproduce the error without this fix but it seems to be fixed.