* Avoid arg expansion that leads to broken code * Preserve new lines and only take comments into account if they break lines * Add robustness against path state corruption due to throwing * Refactor * Remove redundant logic It solved the same issue but only partially. * Simplify further * Refactor path.try, fix callParent issue * Minor refactoring * Add istanbul ignore comment * Add return to AstPath#try Co-authored-by: fisker Cheung <lionkay@gmail.com> Co-authored-by: fisker Cheung <lionkay@gmail.com>
505 B
505 B
Avoid arg expansion that leads to broken code (#10712 by @thorn0)
// Input
glimseGlyphsHazardNoopsTieTie(({ a, b = () => {
console.log();
}}) => averredBathersBoxroomBuggyNurl());
// Prettier stable
glimseGlyphsHazardNoopsTieTie(({ a, b = () => {
console.log();
} }) => averredBathersBoxroomBuggyNurl());
// Prettier main
glimseGlyphsHazardNoopsTieTie(
({
a,
b = () => {
console.log();
},
}) => averredBathersBoxroomBuggyNurl()
);