-
-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(transformer/logic-assignment-operator): add more tests
- Loading branch information
1 parent
97acd88
commit 0c38523
Showing
4 changed files
with
44 additions
and
1 deletion.
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
22 changes: 22 additions & 0 deletions
22
...babel-plugin-transform-logical-assignment-operators/test/fixtures/computed-props/input.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,22 @@ | ||
var _unboundProp, | ||
_unboundObj, | ||
_unboundObj2, | ||
_unboundProp2, | ||
_boundObj$prop, | ||
_boundObj$prop2, | ||
_unboundProp3, | ||
_unboundProp4; | ||
|
||
let boundObj, boundProp; | ||
|
||
boundObj[boundProp] && (boundObj[boundProp] = 1); | ||
boundObj[(_unboundProp = unboundProp)] && (boundObj[_unboundProp] = 2); | ||
|
||
(_unboundObj = unboundObj)[boundProp] && (_unboundObj[boundProp] = 3); | ||
(_unboundObj2 = unboundObj)[(_unboundProp2 = unboundProp)] && (_unboundObj2[_unboundProp2] = 4); | ||
|
||
(_boundObj$prop = boundObj.prop)[boundProp] && (_boundObj$prop[boundProp] = 5); | ||
(_boundObj$prop2 = boundObj.prop)[(_unboundProp3 = unboundProp)] && (_boundObj$prop2[_unboundProp3] = 6); | ||
|
||
this[boundProp] && (this[boundProp] = 7); | ||
this[(_unboundProp4 = unboundProp)] && (this[_unboundProp4] = 8); |
15 changes: 15 additions & 0 deletions
15
...abel-plugin-transform-logical-assignment-operators/test/fixtures/computed-props/output.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,15 @@ | ||
var _unboundProp, _unboundObj, _unboundObj2, _unboundProp2, _boundObj$prop, _boundObj$prop2, _unboundProp3, _unboundProp4; | ||
|
||
let boundObj, boundProp; | ||
|
||
boundObj[boundProp] && (boundObj[boundProp] = 1); | ||
boundObj[_unboundProp = unboundProp] && (boundObj[_unboundProp] = 2); | ||
|
||
(_unboundObj = unboundObj)[boundProp] && (_unboundObj[boundProp] = 3); | ||
(_unboundObj2 = unboundObj)[_unboundProp2 = unboundProp] && (_unboundObj2[_unboundProp2] = 4); | ||
|
||
(_boundObj$prop = boundObj.prop)[boundProp] && (_boundObj$prop[boundProp] = 5); | ||
(_boundObj$prop2 = boundObj.prop)[_unboundProp3 = unboundProp] && (_boundObj$prop2[_unboundProp3] = 6); | ||
|
||
this[boundProp] && (this[boundProp] = 7); | ||
this[_unboundProp4 = unboundProp] && (this[_unboundProp4] = 8); |
5 changes: 5 additions & 0 deletions
5
...ance/tests/babel-plugin-transform-logical-assignment-operators/test/fixtures/options.json
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 @@ | ||
{ | ||
"plugins": [ | ||
"transform-logical-assignment-operators" | ||
] | ||
} |