-
-
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.
refactor(es/ast): Improve type definitions of patterns (#8532)
**Description:** - Copy `AssignmentTarget` from `oxc`. - Use `BindingIdentifier` in more places. **Related issue:** - Closes #8026
- Loading branch information
Showing
369 changed files
with
7,824 additions
and
6,987 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,4 +1,4 @@ | ||
let b; | ||
for(let i = 0; i < 2; ++i)b = 0 === i ? 1 : 2, console.log(0, b); | ||
for(let i = 0; i < 2; ++i)console.log(0, b = 0 === i ? 1 : 2); | ||
let c = 1, d; | ||
while(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,4 +1,4 @@ | ||
let b, c, d; | ||
for(let i = 0; i < 2; ++i)b = 0 === i ? 1 : 2, console.log(0, b); | ||
for(let i = 0; i < 2; ++i)console.log(0, b = 0 === i ? 1 : 2); | ||
c = 1; | ||
while(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,7 +1,6 @@ | ||
export var fn = function() { | ||
var varA; | ||
return(// a bad comment | ||
varA = condCheck ? "a" : "b", objCreator({ | ||
varA: varA | ||
})); | ||
return objCreator({ | ||
varA: condCheck ? // a bad comment | ||
"a" : "b" | ||
}); | ||
}; |
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
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
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: 3 additions & 3 deletions
6
crates/swc/tests/tsc-references/computedPropertyNames1_ES5.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,6 +1,6 @@ | ||
//// [computedPropertyNames1_ES5.ts] | ||
import { _ as _define_enumerable_properties } from "@swc/helpers/_/_define_enumerable_properties"; | ||
var _mutatorMap = {}; | ||
_mutatorMap[1] = _mutatorMap[1] || {}, _mutatorMap[1].get = function() { | ||
var _obj, _mutatorMap = {}; | ||
_obj = {}, _mutatorMap[1] = _mutatorMap[1] || {}, _mutatorMap[1].get = function() { | ||
return 0; | ||
}, _mutatorMap[1] = _mutatorMap[1] || {}, _mutatorMap[1].set = function(v) {}, _define_enumerable_properties({}, _mutatorMap); | ||
}, _mutatorMap[1] = _mutatorMap[1] || {}, _mutatorMap[1].set = function(v) {}, _define_enumerable_properties(_obj, _mutatorMap); |
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
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
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
8 changes: 1 addition & 7 deletions
8
crates/swc/tests/tsc-references/intersectionReduction.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,8 +1,2 @@ | ||
//// [intersectionReduction.ts] | ||
ab.kind, x, f10(a1), f10(a2), ({ | ||
a: "foo", | ||
b: 42 | ||
})[k] = "bar", ({ | ||
a: "foo", | ||
b: !0 | ||
})[k] = "bar", s2 = s1 = s2, t2 = t1 = t2, shouldBeB; | ||
ab.kind, x, f10(a1), f10(a2), s2 = s1 = s2, t2 = t1 = t2, shouldBeB; |
8 changes: 1 addition & 7 deletions
8
crates/swc/tests/tsc-references/intersectionReductionStrict.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,8 +1,2 @@ | ||
//// [intersectionReductionStrict.ts] | ||
ab.kind, x, ({ | ||
a: "foo", | ||
b: 42 | ||
})[k] = "bar", ({ | ||
a: "foo", | ||
b: !0 | ||
})[k] = "bar", s2 = s1 = s2, t2 = t1 = t2; | ||
ab.kind, x, s2 = s1 = s2, t2 = t1 = t2; |
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
5 changes: 2 additions & 3 deletions
5
crates/swc/tests/tsc-references/numericStringLiteralTypes.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,6 +1,5 @@ | ||
//// [numericStringLiteralTypes.ts] | ||
var container1 = createContainer("hi"), container2 = createContainer(2); | ||
f([ | ||
container1, | ||
container2 | ||
createContainer("hi"), | ||
createContainer(2) | ||
], function(value1, value2) {}); |
33 changes: 9 additions & 24 deletions
33
crates/swc/tests/tsc-references/optionalChainingInference.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,33 +1,18 @@ | ||
//// [optionalChainingInference.ts] | ||
var b1 = { | ||
unbox({ | ||
value: null == su ? void 0 : su.length | ||
}; | ||
unbox(b1); | ||
var b2 = { | ||
}), unbox({ | ||
value: null == su ? void 0 : su.length | ||
}; | ||
unbox(b2); | ||
var b3 = { | ||
}), unbox({ | ||
value: null == su ? void 0 : su.length | ||
}; | ||
unbox(b3); | ||
var b4 = { | ||
}), unbox({ | ||
value: null == fnu ? void 0 : fnu() | ||
}; | ||
unbox(b4); | ||
var b5 = { | ||
}), unbox({ | ||
value: null == su ? void 0 : su.length | ||
}; | ||
unbox(b5); | ||
var b6 = { | ||
}), unbox({ | ||
value: null == osu ? void 0 : osu.prop.length | ||
}; | ||
unbox(b6); | ||
var b7 = { | ||
}), unbox({ | ||
value: null == osu ? void 0 : osu.prop.length | ||
}; | ||
unbox(b7); | ||
var b8 = { | ||
}), unbox({ | ||
value: null == ofnu ? void 0 : ofnu.prop() | ||
}; | ||
unbox(b8); | ||
}); |
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
4 changes: 2 additions & 2 deletions
4
crates/swc/tests/tsc-references/parserES5ComputedPropertyName4.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,4 +1,4 @@ | ||
//// [parserES5ComputedPropertyName4.ts] | ||
import { _ as _define_enumerable_properties } from "@swc/helpers/_/_define_enumerable_properties"; | ||
var _mutatorMap = {}; | ||
_mutatorMap[e] = _mutatorMap[e] || {}, _mutatorMap[e].get = function() {}, _define_enumerable_properties({}, _mutatorMap); | ||
var _obj, _mutatorMap = {}; | ||
_obj = {}, _mutatorMap[e] = _mutatorMap[e] || {}, _mutatorMap[e].get = function() {}, _define_enumerable_properties(_obj, _mutatorMap); |
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
Oops, something went wrong.