-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
199 additions
and
177 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,86 @@ | ||
//// [callChain.ts] | ||
var _o2, _o21, _o22, _o23, _o3_b, _o3_b1, _o3_b2, _o3_b3, _o3_b4, _o3_b5; | ||
var _o3_b6, _o3_b7, _o3_b8, _o3_b9, _o3_b10, _o3_b11, _o3_b12, _o3_b13, _o3_b14, _o3_b15, _o3_b16, _o3_b17, _o5; | ||
o1 === null || o1 === void 0 ? void 0 : o1(); | ||
o1 === null || o1 === void 0 ? void 0 : o1(1); | ||
o1 === null || o1 === void 0 ? void 0 : o1.apply(void 0, [ | ||
var _o1, _o11, _o12, _o13, _o24, _o25, _o26, _o27, _o28, _o29, _o210, _o211, _o3_b6, _o3, _o3_b7, _o31, _o3_b8, _o32, _o3_b9, _o33, _o3_b10, _o34, _o3_b11, _o35, _o3_b12, _o36, _o3_b13, _o37, _o3_b14, _o38, _o3_b15, _o39, _o3_b16, _o310, _o3_b17, _o311, _o4, _o5, // GH#36031 | ||
_o212, _o213; | ||
(_o1 = o1) === null || _o1 === void 0 ? void 0 : _o1(); | ||
(_o11 = o1) === null || _o11 === void 0 ? void 0 : _o11(1); | ||
(_o12 = o1) === null || _o12 === void 0 ? void 0 : _o12.apply(void 0, [ | ||
1, | ||
2 | ||
]); | ||
o1 === null || o1 === void 0 ? void 0 : o1.apply(void 0, [ | ||
(_o13 = o1) === null || _o13 === void 0 ? void 0 : _o13.apply(void 0, [ | ||
1, | ||
2, | ||
3, | ||
4 | ||
]); | ||
o2 === null || o2 === void 0 ? void 0 : o2.b(); | ||
o2 === null || o2 === void 0 ? void 0 : o2.b(1); | ||
o2 === null || o2 === void 0 ? void 0 : (_o2 = o2).b.apply(_o2, [ | ||
(_o24 = o2) === null || _o24 === void 0 ? void 0 : _o24.b(); | ||
(_o25 = o2) === null || _o25 === void 0 ? void 0 : _o25.b(1); | ||
(_o26 = o2) === null || _o26 === void 0 ? void 0 : (_o2 = _o26).b.apply(_o2, [ | ||
1, | ||
2 | ||
]); | ||
o2 === null || o2 === void 0 ? void 0 : (_o21 = o2).b.apply(_o21, [ | ||
(_o27 = o2) === null || _o27 === void 0 ? void 0 : (_o21 = _o27).b.apply(_o21, [ | ||
1, | ||
2, | ||
3, | ||
4 | ||
]); | ||
o2 === null || o2 === void 0 ? void 0 : o2["b"](); | ||
o2 === null || o2 === void 0 ? void 0 : o2["b"](1); | ||
o2 === null || o2 === void 0 ? void 0 : (_o22 = o2)["b"].apply(_o22, [ | ||
(_o28 = o2) === null || _o28 === void 0 ? void 0 : _o28["b"](); | ||
(_o29 = o2) === null || _o29 === void 0 ? void 0 : _o29["b"](1); | ||
(_o210 = o2) === null || _o210 === void 0 ? void 0 : (_o22 = _o210)["b"].apply(_o22, [ | ||
1, | ||
2 | ||
]); | ||
o2 === null || o2 === void 0 ? void 0 : (_o23 = o2)["b"].apply(_o23, [ | ||
(_o211 = o2) === null || _o211 === void 0 ? void 0 : (_o23 = _o211)["b"].apply(_o23, [ | ||
1, | ||
2, | ||
3, | ||
4 | ||
]); | ||
(_o3_b6 = o3.b) === null || _o3_b6 === void 0 ? void 0 : _o3_b6.call(o3).c; | ||
(_o3_b7 = o3.b) === null || _o3_b7 === void 0 ? void 0 : _o3_b7.call(o3, 1).c; | ||
(_o3_b8 = o3.b) === null || _o3_b8 === void 0 ? void 0 : (_o3_b = _o3_b8).call.apply(_o3_b, [ | ||
o3, | ||
(_o3_b6 = (_o3 = o3).b) === null || _o3_b6 === void 0 ? void 0 : _o3_b6.call(_o3).c; | ||
(_o3_b7 = (_o31 = o3).b) === null || _o3_b7 === void 0 ? void 0 : _o3_b7.call(_o31, 1).c; | ||
(_o3_b8 = (_o32 = o3).b) === null || _o3_b8 === void 0 ? void 0 : (_o3_b = _o3_b8).call.apply(_o3_b, [ | ||
_o32, | ||
1, | ||
2 | ||
]).c; | ||
(_o3_b9 = o3.b) === null || _o3_b9 === void 0 ? void 0 : (_o3_b1 = _o3_b9).call.apply(_o3_b1, [ | ||
o3, | ||
(_o3_b9 = (_o33 = o3).b) === null || _o3_b9 === void 0 ? void 0 : (_o3_b1 = _o3_b9).call.apply(_o3_b1, [ | ||
_o33, | ||
1, | ||
2, | ||
3, | ||
4 | ||
]).c; | ||
(_o3_b10 = o3.b) === null || _o3_b10 === void 0 ? void 0 : _o3_b10.call(o3)["c"]; | ||
(_o3_b11 = o3.b) === null || _o3_b11 === void 0 ? void 0 : _o3_b11.call(o3, 1)["c"]; | ||
(_o3_b12 = o3.b) === null || _o3_b12 === void 0 ? void 0 : (_o3_b2 = _o3_b12).call.apply(_o3_b2, [ | ||
o3, | ||
(_o3_b10 = (_o34 = o3).b) === null || _o3_b10 === void 0 ? void 0 : _o3_b10.call(_o34)["c"]; | ||
(_o3_b11 = (_o35 = o3).b) === null || _o3_b11 === void 0 ? void 0 : _o3_b11.call(_o35, 1)["c"]; | ||
(_o3_b12 = (_o36 = o3).b) === null || _o3_b12 === void 0 ? void 0 : (_o3_b2 = _o3_b12).call.apply(_o3_b2, [ | ||
_o36, | ||
1, | ||
2 | ||
])["c"]; | ||
(_o3_b13 = o3.b) === null || _o3_b13 === void 0 ? void 0 : (_o3_b3 = _o3_b13).call.apply(_o3_b3, [ | ||
o3, | ||
(_o3_b13 = (_o37 = o3).b) === null || _o3_b13 === void 0 ? void 0 : (_o3_b3 = _o3_b13).call.apply(_o3_b3, [ | ||
_o37, | ||
1, | ||
2, | ||
3, | ||
4 | ||
])["c"]; | ||
(_o3_b14 = o3["b"]) === null || _o3_b14 === void 0 ? void 0 : _o3_b14.call(o3).c; | ||
(_o3_b15 = o3["b"]) === null || _o3_b15 === void 0 ? void 0 : _o3_b15.call(o3, 1).c; | ||
(_o3_b16 = o3["b"]) === null || _o3_b16 === void 0 ? void 0 : (_o3_b4 = _o3_b16).call.apply(_o3_b4, [ | ||
o3, | ||
(_o3_b14 = (_o38 = o3)["b"]) === null || _o3_b14 === void 0 ? void 0 : _o3_b14.call(_o38).c; | ||
(_o3_b15 = (_o39 = o3)["b"]) === null || _o3_b15 === void 0 ? void 0 : _o3_b15.call(_o39, 1).c; | ||
(_o3_b16 = (_o310 = o3)["b"]) === null || _o3_b16 === void 0 ? void 0 : (_o3_b4 = _o3_b16).call.apply(_o3_b4, [ | ||
_o310, | ||
1, | ||
2 | ||
]).c; | ||
(_o3_b17 = o3["b"]) === null || _o3_b17 === void 0 ? void 0 : (_o3_b5 = _o3_b17).call.apply(_o3_b5, [ | ||
o3, | ||
(_o3_b17 = (_o311 = o3)["b"]) === null || _o3_b17 === void 0 ? void 0 : (_o3_b5 = _o3_b17).call.apply(_o3_b5, [ | ||
_o311, | ||
1, | ||
2, | ||
3, | ||
4 | ||
]).c; | ||
var v = o4 === null || o4 === void 0 ? void 0 : o4(incr); | ||
var v = (_o4 = o4) === null || _o4 === void 0 ? void 0 : _o4(incr); | ||
(_o5 = o5()) === null || _o5 === void 0 ? void 0 : _o5(); | ||
// GH#36031 | ||
o2 === null || o2 === void 0 ? void 0 : o2.b().toString; | ||
o2 === null || o2 === void 0 ? void 0 : o2.b().toString; | ||
(_o212 = o2) === null || _o212 === void 0 ? void 0 : _o212.b().toString; | ||
(_o213 = o2) === null || _o213 === void 0 ? void 0 : _o213.b().toString; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//// [callChain.2.ts] | ||
var _o3_b; | ||
o1 === null || o1 === void 0 ? void 0 : o1(); | ||
o2 === null || o2 === void 0 ? void 0 : o2.b(); | ||
(_o3_b = o3.b) === null || _o3_b === void 0 ? void 0 : _o3_b.call(o3).c; | ||
var _o1, _o2, _o3_b, _o3; | ||
(_o1 = o1) === null || _o1 === void 0 ? void 0 : _o1(); | ||
(_o2 = o2) === null || _o2 === void 0 ? void 0 : _o2.b(); | ||
(_o3_b = (_o3 = o3).b) === null || _o3_b === void 0 ? void 0 : _o3_b.call(_o3).c; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
//// [callChain.2.ts] | ||
var _o3_b; | ||
null == o1 || o1(), null == o2 || o2.b(), null === (_o3_b = o3.b) || void 0 === _o3_b || _o3_b.call(o3).c; | ||
var _o1, _o2, _o3_b, _o3; | ||
null === (_o1 = o1) || void 0 === _o1 || _o1(), null === (_o2 = o2) || void 0 === _o2 || _o2.b(), null === (_o3_b = (_o3 = o3).b) || void 0 === _o3_b || _o3_b.call(_o3).c; |
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 |
---|---|---|
@@ -1,57 +1,57 @@ | ||
//// [callChain.ts] | ||
var _o2, _o21, _o22, _o23, _o3_b6, _o3_b7, _o3_b8, _o3_b9, _o3_b10, _o3_b11, _o3_b12, _o3_b13, _o3_b14, _o3_b15, _o3_b16, _o3_b17, _o5; | ||
null == o1 || o1(), null == o1 || o1(1), null == o1 || o1.apply(void 0, [ | ||
var _o1, _o11, _o12, _o13, _o24, _o25, _o26, _o27, _o28, _o29, _o210, _o211, _o3_b6, _o3, _o3_b7, _o31, _o3_b8, _o32, _o3_b9, _o33, _o3_b10, _o34, _o3_b11, _o35, _o3_b12, _o36, _o3_b13, _o37, _o3_b14, _o38, _o3_b15, _o39, _o3_b16, _o310, _o3_b17, _o311, _o4, _o5, _o212, _o213; | ||
null === (_o1 = o1) || void 0 === _o1 || _o1(), null === (_o11 = o1) || void 0 === _o11 || _o11(1), null === (_o12 = o1) || void 0 === _o12 || _o12.apply(void 0, [ | ||
1, | ||
2 | ||
]), null == o1 || o1.apply(void 0, [ | ||
]), null === (_o13 = o1) || void 0 === _o13 || _o13.apply(void 0, [ | ||
1, | ||
2, | ||
3, | ||
4 | ||
]), null == o2 || o2.b(), null == o2 || o2.b(1), null == o2 || (_o2 = o2).b.apply(_o2, [ | ||
]), null === (_o24 = o2) || void 0 === _o24 || _o24.b(), null === (_o25 = o2) || void 0 === _o25 || _o25.b(1), null === (_o26 = o2) || void 0 === _o26 || _o26.b.apply(_o26, [ | ||
1, | ||
2 | ||
]), null == o2 || (_o21 = o2).b.apply(_o21, [ | ||
]), null === (_o27 = o2) || void 0 === _o27 || _o27.b.apply(_o27, [ | ||
1, | ||
2, | ||
3, | ||
4 | ||
]), null == o2 || o2.b(), null == o2 || o2.b(1), null == o2 || (_o22 = o2).b.apply(_o22, [ | ||
]), null === (_o28 = o2) || void 0 === _o28 || _o28.b(), null === (_o29 = o2) || void 0 === _o29 || _o29.b(1), null === (_o210 = o2) || void 0 === _o210 || _o210.b.apply(_o210, [ | ||
1, | ||
2 | ||
]), null == o2 || (_o23 = o2).b.apply(_o23, [ | ||
]), null === (_o211 = o2) || void 0 === _o211 || _o211.b.apply(_o211, [ | ||
1, | ||
2, | ||
3, | ||
4 | ||
]), null === (_o3_b6 = o3.b) || void 0 === _o3_b6 || _o3_b6.call(o3).c, null === (_o3_b7 = o3.b) || void 0 === _o3_b7 || _o3_b7.call(o3, 1).c, null === (_o3_b8 = o3.b) || void 0 === _o3_b8 || _o3_b8.call.apply(_o3_b8, [ | ||
o3, | ||
]), null === (_o3_b6 = (_o3 = o3).b) || void 0 === _o3_b6 || _o3_b6.call(_o3).c, null === (_o3_b7 = (_o31 = o3).b) || void 0 === _o3_b7 || _o3_b7.call(_o31, 1).c, null === (_o3_b8 = (_o32 = o3).b) || void 0 === _o3_b8 || _o3_b8.call.apply(_o3_b8, [ | ||
_o32, | ||
1, | ||
2 | ||
]).c, null === (_o3_b9 = o3.b) || void 0 === _o3_b9 || _o3_b9.call.apply(_o3_b9, [ | ||
o3, | ||
]).c, null === (_o3_b9 = (_o33 = o3).b) || void 0 === _o3_b9 || _o3_b9.call.apply(_o3_b9, [ | ||
_o33, | ||
1, | ||
2, | ||
3, | ||
4 | ||
]).c, null === (_o3_b10 = o3.b) || void 0 === _o3_b10 || _o3_b10.call(o3).c, null === (_o3_b11 = o3.b) || void 0 === _o3_b11 || _o3_b11.call(o3, 1).c, null === (_o3_b12 = o3.b) || void 0 === _o3_b12 || _o3_b12.call.apply(_o3_b12, [ | ||
o3, | ||
]).c, null === (_o3_b10 = (_o34 = o3).b) || void 0 === _o3_b10 || _o3_b10.call(_o34).c, null === (_o3_b11 = (_o35 = o3).b) || void 0 === _o3_b11 || _o3_b11.call(_o35, 1).c, null === (_o3_b12 = (_o36 = o3).b) || void 0 === _o3_b12 || _o3_b12.call.apply(_o3_b12, [ | ||
_o36, | ||
1, | ||
2 | ||
]).c, null === (_o3_b13 = o3.b) || void 0 === _o3_b13 || _o3_b13.call.apply(_o3_b13, [ | ||
o3, | ||
]).c, null === (_o3_b13 = (_o37 = o3).b) || void 0 === _o3_b13 || _o3_b13.call.apply(_o3_b13, [ | ||
_o37, | ||
1, | ||
2, | ||
3, | ||
4 | ||
]).c, null === (_o3_b14 = o3.b) || void 0 === _o3_b14 || _o3_b14.call(o3).c, null === (_o3_b15 = o3.b) || void 0 === _o3_b15 || _o3_b15.call(o3, 1).c, null === (_o3_b16 = o3.b) || void 0 === _o3_b16 || _o3_b16.call.apply(_o3_b16, [ | ||
o3, | ||
]).c, null === (_o3_b14 = (_o38 = o3).b) || void 0 === _o3_b14 || _o3_b14.call(_o38).c, null === (_o3_b15 = (_o39 = o3).b) || void 0 === _o3_b15 || _o3_b15.call(_o39, 1).c, null === (_o3_b16 = (_o310 = o3).b) || void 0 === _o3_b16 || _o3_b16.call.apply(_o3_b16, [ | ||
_o310, | ||
1, | ||
2 | ||
]).c, null === (_o3_b17 = o3.b) || void 0 === _o3_b17 || _o3_b17.call.apply(_o3_b17, [ | ||
o3, | ||
]).c, null === (_o3_b17 = (_o311 = o3).b) || void 0 === _o3_b17 || _o3_b17.call.apply(_o3_b17, [ | ||
_o311, | ||
1, | ||
2, | ||
3, | ||
4 | ||
]).c, null == o4 || o4(incr), null === (_o5 = o5()) || void 0 === _o5 || _o5(), null == o2 || o2.b().toString, null == o2 || o2.b().toString; | ||
]).c, null === (_o4 = o4) || void 0 === _o4 || _o4(incr), null === (_o5 = o5()) || void 0 === _o5 || _o5(), null === (_o212 = o2) || void 0 === _o212 || _o212.b().toString, null === (_o213 = o2) || void 0 === _o213 || _o213.b().toString; |
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
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
6 changes: 4 additions & 2 deletions
6
crates/swc/tests/tsc-references/callChainInference.1.normal.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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
//// [callChainInference.ts] | ||
// Repro from #42404 | ||
var _value; | ||
if (value) { | ||
value === null || value === void 0 ? void 0 : value.foo("a"); | ||
var _value1; | ||
(_value1 = value) === null || _value1 === void 0 ? void 0 : _value1.foo("a"); | ||
} | ||
value === null || value === void 0 ? void 0 : value.foo("a"); | ||
(_value = value) === null || _value === void 0 ? void 0 : _value.foo("a"); |
3 changes: 2 additions & 1 deletion
3
crates/swc/tests/tsc-references/callChainInference.2.minified.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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
//// [callChainInference.ts] | ||
value && (null == value || value.foo("a")), null == value || value.foo("a"); | ||
var _value, _value1; | ||
value && (null === (_value1 = value) || void 0 === _value1 || _value1.foo("a")), null === (_value = value) || void 0 === _value || _value.foo("a"); |
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
Oops, something went wrong.