Skip to content

Commit

Permalink
test(transformer/logic-assignment-operator): add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 9, 2024
1 parent 97acd88 commit 0c38523
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/transform_conformance/snapshots/oxc.snap.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
commit: 54a8389f

Passed: 96/108
Passed: 97/109

# All Passed:
* babel-plugin-transform-class-static-block
* babel-plugin-transform-logical-assignment-operators
* babel-plugin-transform-nullish-coalescing-operator
* babel-plugin-transform-optional-catch-binding
* babel-plugin-transform-async-generator-functions
Expand Down
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);
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);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": [
"transform-logical-assignment-operators"
]
}

0 comments on commit 0c38523

Please sign in to comment.