Skip to content

Commit 65f1219

Browse files
committed
[core][rewriter] enable full-tree walking of location assignment rewrites
1 parent bb6a3a8 commit 65f1219

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

rewriter/js/src/visitor.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ where
386386
Expression::Identifier(_) =>{
387387
// `typeof location` -> `typeof $wrap(location)` seems like a sane rewrite but it's incorrect
388388
// typeof has the special property of not caring whether the identifier is undefined
389+
// and this won't escape anyway, so don't rewrite
389390
return;
390391
}
391392
_=>{
@@ -486,10 +487,6 @@ where
486487
op: it.operator,
487488
}
488489
));
489-
490-
// avoid walking rest of tree, i would need to figure out nested rewrites
491-
// somehow
492-
return;
493490
}
494491
}
495492
AssignmentTarget::StaticMemberExpression(s) => {

0 commit comments

Comments
 (0)