-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/bugfixes): Fix fn transform in nameless fns (#8796)
**Description:** This pull request fixes `bugfix/transform-safari-id-destructuring-collision-in-function-expression` module. Previously the transform ignored code inside of function which did not have specified identifier. Now the visitor should go through the content of the nameless functions. **Related issue:** - Closes #8788
- Loading branch information
1 parent
56e03a1
commit 7ad004e
Showing
3 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...shots__/src/safari_id_destructuring_collision_in_function_expression.rs/in_nameless_fn.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(function () { | ||
(function a(_a) { | ||
_a; | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
...rc/safari_id_destructuring_collision_in_function_expression.rs/in_nameless_fn_multiple.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// nameless iife | ||
var x = function() { | ||
// not transformed | ||
var b = function a(_a) { | ||
return _a; | ||
}; | ||
}(); | ||
// nameless iife | ||
var x = function x() { | ||
var b = function a(_a) { | ||
return _a; | ||
}; | ||
}(); | ||
// nameless function | ||
(function() { | ||
// not transformed | ||
var b = function a(_a1) { | ||
return _a1; | ||
}; | ||
}); | ||
// named function | ||
(function x() { | ||
var b = function a(_a) { | ||
return _a; | ||
}; | ||
}); |