Skip to content
This repository was archived by the owner on Jan 14, 2019. It is now read-only.

Commit 9c47ac0

Browse files
committed
fix: add regression tests and fix one edge case
1 parent f82c76e commit 9c47ac0

13 files changed

+10711
-4408
lines changed

src/convert.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
17191719
left: converter(
17201720
node.left,
17211721
config.inTypeMode,
1722-
type !== AST_NODE_TYPES.BinaryExpression
1722+
type === AST_NODE_TYPES.AssignmentExpression
17231723
),
17241724
right: convertChild(node.right)
17251725
});

tests/ast-alignment/fixtures-to-test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ tester.addFixturePatternConfig('javascript/bigIntLiterals');
168168
tester.addFixturePatternConfig('javascript/binaryLiterals');
169169
tester.addFixturePatternConfig('javascript/blockBindings');
170170

171+
tester.addFixturePatternConfig('javascript/callExpression');
172+
171173
tester.addFixturePatternConfig('javascript/classes', {
172174
ignore: [
173175
/**
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var v = {} && {} && [] && "" && ("" && {});
2+
var x = [] && [] && {} && "" && ("" && []);
3+
var z = [] && [];
4+
var y = {} && {};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var v = {} || {} || [] || "" || ("" || {});
2+
var x = [] || [] || {} || "" || ("" || []);
3+
var z = [] || [];
4+
var y = {} || {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
foo([]);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
foo({});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(function () {
2+
(function () {
3+
this.call({}, [])
4+
})([]);
5+
})({});
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
new bar([]);
2+
new bar([[{}]]);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
new bar({});
2+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
foo(...[]);

0 commit comments

Comments
 (0)