@@ -562,11 +562,13 @@ Parser.prototype.walkLogicalExpression = function walkLeftRightExpression(expres
562562
563563Parser . prototype . walkAssignmentExpression = function walkAssignmentExpression ( expression ) {
564564 var renameIdentifier = this . getRenameIdentifier ( expression . right ) ;
565- if ( expression . left . type === "Identifier" && renameIdentifier && ! this . applyPluginsBailResult ( "rename " + renameIdentifier , expression . right ) ) {
565+ if ( expression . left . type === "Identifier" && renameIdentifier && this . applyPluginsBailResult ( "can- rename " + renameIdentifier , expression . right ) ) {
566566 // renaming "a = b;"
567- this . scope . renames [ "$" + expression . left . name ] = renameIdentifier ;
568- var idx = this . scope . definitions . indexOf ( expression . left . name ) ;
569- if ( idx >= 0 ) this . scope . definitions . splice ( idx , 1 ) ;
567+ if ( ! this . applyPluginsBailResult ( "rename " + renameIdentifier , expression . right ) ) {
568+ this . scope . renames [ "$" + expression . left . name ] = renameIdentifier ;
569+ var idx = this . scope . definitions . indexOf ( expression . left . name ) ;
570+ if ( idx >= 0 ) this . scope . definitions . splice ( idx , 1 ) ;
571+ }
570572 } else if ( expression . left . type === "Identifier" ) {
571573 if ( ! this . applyPluginsBailResult ( "assigned " + expression . left . name , expression ) ) {
572574 this . walkExpression ( expression . right ) ;
@@ -608,13 +610,11 @@ Parser.prototype.walkCallExpression = function walkCallExpression(expression) {
608610 var params = functionExpression . params ;
609611 var args = args . map ( function ( arg , idx ) {
610612 var renameIdentifier = this . getRenameIdentifier ( arg ) ;
611- if ( ! renameIdentifier ) {
612- this . walkExpression ( arg ) ;
613- return ;
614- } else if ( this . applyPluginsBailResult ( "rename " + renameIdentifier , arg ) ) {
615- return ;
613+ if ( renameIdentifier && this . applyPluginsBailResult ( "can-rename " + renameIdentifier , arg ) ) {
614+ if ( ! this . applyPluginsBailResult ( "rename " + renameIdentifier , arg ) )
615+ return renameIdentifier ;
616616 }
617- return renameIdentifier ;
617+ this . walkExpression ( arg ) ;
618618 } , this ) ;
619619 this . inScope ( params . filter ( function ( identifier , idx ) {
620620 return ! args [ idx ] ;
0 commit comments