File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -153,13 +153,14 @@ var OperatorOutlining = /** @class */ (function (_super) {
153
153
if ( node . type === 'AssignmentExpression' ) {
154
154
if ( node . operator !== '=' && node . left . type === 'Identifier' ) {
155
155
if ( Math . random ( ) <= _this . settings . assignmentOperatorChance ) {
156
+ // @ts -ignore
156
157
return {
157
158
type : 'AssignmentExpression' ,
158
159
operator : '=' ,
159
160
left : node . left ,
160
161
right : {
161
162
type : 'BinaryExpression' ,
162
- operator : '+' ,
163
+ operator : node . operator . substring ( 0 , node . operator . length - 1 ) ,
163
164
left : node . left ,
164
165
right : node . right
165
166
}
Original file line number Diff line number Diff line change @@ -137,13 +137,14 @@ class OperatorOutlining extends BaseTransformation {
137
137
if ( node . type === 'AssignmentExpression' ) {
138
138
if ( node . operator !== '=' && node . left . type === 'Identifier' ) {
139
139
if ( Math . random ( ) <= this . settings . assignmentOperatorChance ) {
140
+ // @ts -ignore
140
141
return {
141
142
type : 'AssignmentExpression' ,
142
143
operator : '=' ,
143
144
left : node . left ,
144
145
right : {
145
146
type : 'BinaryExpression' ,
146
- operator : '+' ,
147
+ operator : node . operator . substring ( 0 , node . operator . length - 1 ) ,
147
148
left : node . left ,
148
149
right : node . right
149
150
}
You can’t perform that action at this time.
0 commit comments