@swc/core 1.2.125 → 1.2.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,209 @@
5
5
 
6
6
 
7
7
 
8
+ - **(es/compat)** Transform `&&=` operator (#3225) ([2e5150d](https://github.com/swc-project/swc/commit/2e5150d2b714ba86bd228506eb0f008d9f5859e1))
9
+
10
+
11
+ - **(es/minifier)** Fix handling of inlined call to a hoisted function (#3223) ([78720c4](https://github.com/swc-project/swc/commit/78720c4c91530165b24585dab635f13eea9997a3))
12
+
13
+
14
+ - **(es/minifier)** Fix optimization of assignment expressions (#3231) ([12dd0a6](https://github.com/swc-project/swc/commit/12dd0a6c1fb6eeaf603f0f1a6da3a4231c8c47f6))
15
+
16
+
17
+ - **(es/minifier)** Fix bugs (#3238) ([74fd353](https://github.com/swc-project/swc/commit/74fd3530535813023b77739dd8f37a682269be67))
18
+
19
+
20
+ - **(es/parser)** Fix span of `ComputedPropName` (#3234) ([105cbc2](https://github.com/swc-project/swc/commit/105cbc2017e20a7c6a5d7dfdd7a9a4c396032be9))
21
+
22
+
23
+ - **(es/typescript)** Remove rogue `println` (#3244) ([282232c](https://github.com/swc-project/swc/commit/282232c9958309e70a18799449802ef5d7e88123))
24
+
25
+ ### Features
26
+
27
+
28
+
29
+ - **(plugin)** Don't serialize/deserialize needlessly (#3227) ([a2f2b5a](https://github.com/swc-project/swc/commit/a2f2b5ac8924ce635fc9547057da287864fe188a))
30
+
31
+
32
+ - **(plugin/macro)** Add safe API for plugins based on a proc-macro (#3240) ([432d5d3](https://github.com/swc-project/swc/commit/432d5d3fb7d870b08f8c16e4147c3f5421693d2b))
33
+
34
+ ## [1.2.128] - 2022-01-11
35
+
36
+ ### Bug Fixes
37
+
38
+
39
+
40
+ - **(es/helpers)** Don't transpile `_typeof` helper (#3208) ([54353a6](https://github.com/swc-project/swc/commit/54353a6fb5ab53ed4762161ecdda1a3ec0d77c62))
41
+
42
+
43
+ - **(es/hygiene)** Visit computed properties in usage analyzer (#3217) ([cdb46cf](https://github.com/swc-project/swc/commit/cdb46cfb9180e67915c88eabdfd48317870e330d))
44
+
45
+
46
+ - **(es/minifier)** Disable inlining of expressions from `collapse_vars` (#3200) ([69b5f79](https://github.com/swc-project/swc/commit/69b5f799f3d40947ce3b5bc851ee44d3caad5328))
47
+
48
+
49
+ - **(es/minifier)** Drop unreachable statements eagerly (#3204) ([0105939](https://github.com/swc-project/swc/commit/01059394268791d85d48d9c1cbfa11564b1eb85e))
50
+
51
+
52
+ - **(es/modules)** Fix lazy import handling (#3211) ([9565149](https://github.com/swc-project/swc/commit/956514953940556847e7a5b42d7f1f21cffe9dd8))
53
+
54
+ ### Features
55
+
56
+
57
+
58
+ - **(es/ast)** Use `ModuleExportName` for `ExportNamespaceSpecifier` (#3195) ([432f877](https://github.com/swc-project/swc/commit/432f87779003e50f17bcaedc35edb8583644c548))
59
+
60
+
61
+ - **(es/ast)** Update `is-macro` (#3226) ([1edbf1a](https://github.com/swc-project/swc/commit/1edbf1a37a37c5e3a9bf695b4793d0c35c2d6592))
62
+
63
+
64
+ - **(es/compat)** Implement object super (#3127) ([b649d23](https://github.com/swc-project/swc/commit/b649d23bac1faf5ae0ba9463ba9069d09055b63c))
65
+
66
+
67
+ - **(es/parser)** Accept strings for import/exports (#3190) ([3fb76f6](https://github.com/swc-project/swc/commit/3fb76f64c4e5ee49b0415757b3ead5fc753a93b6))
68
+
69
+
70
+ - **(es/transforms)** Add `Assumptions` (#3215) ([42f7268](https://github.com/swc-project/swc/commit/42f726873e6c9e813a750acbf6d818bd4e914e31))
71
+
72
+
73
+ - **(plugin)** Pass serialized ast to a wasm file (#3199) ([92de2c7](https://github.com/swc-project/swc/commit/92de2c78841ee1dc8b372268690637a19c3f4307))
74
+
75
+
76
+ - **(plugin)** Allow multi-value for the plugin signature (#3216) ([c9ded9b](https://github.com/swc-project/swc/commit/c9ded9b72080b013466f450d9b3917055e40fa23))
77
+
78
+
79
+ - **(plugin)** Perform actual transforms in plugins (#3220) ([7e7421e](https://github.com/swc-project/swc/commit/7e7421ea527f499c6488de19fb8171f2b65787b4))
80
+
81
+ ### Miscellaneous Tasks
82
+
83
+
84
+
85
+ - **(es/minifier)** Add scripts to extract tests automatically (#3212) ([057fca4](https://github.com/swc-project/swc/commit/057fca4196263dcfc05e6161cb727ec4888d7e10))
86
+
87
+ ### Refactor
88
+
89
+
90
+
91
+ - **(es/ast)** Change types of member-like expressions (#3178) ([f58b50b](https://github.com/swc-project/swc/commit/f58b50bea7507def95b94b498ba9c5faf55df802))
92
+
93
+
94
+ - **(es/compat)** Preserve length of functions in `async_generator` (#3202) ([5bee4e4](https://github.com/swc-project/swc/commit/5bee4e490229a3a045d4008b156034c4233ec89e))
95
+
96
+ ### Security
97
+
98
+
99
+
100
+ - **(repo)** Fix crev integration (#3210) ([70c2f3b](https://github.com/swc-project/swc/commit/70c2f3b3a57ec9afc1f28ec1c6377dbbf4e920b6))
101
+
102
+ ## [1.2.127] - 2022-01-06
103
+
104
+ ### Bug Fixes
105
+
106
+
107
+
108
+ - **(es/lints)** Fix incorrect duplicate binding error (#3194) ([913c82a](https://github.com/swc-project/swc/commit/913c82a2ab94e14eb350e1573af736aa87c7f2bb))
109
+
110
+
111
+ - **(es/minifier)** Fix bugs (#2955) ([1c1c9f0](https://github.com/swc-project/swc/commit/1c1c9f0eaee4993d2a8e7c9714e3bab00123f14b))
112
+
113
+
114
+ - **(es/visit)** Make `noop_visit_type` visit typescript nodes that executes at runtime (#3192) ([517662c](https://github.com/swc-project/swc/commit/517662c9c243aa56451025563a7b7e57fd24d9d0))
115
+
116
+ ### Features
117
+
118
+
119
+
120
+ - **(es/dep-graph)** Improve DependencyDescriptor to combine `import_assertions` with `dynamic_import_assertions` (#3183) ([e5e6e84](https://github.com/swc-project/swc/commit/e5e6e843004b7ad3ce0ffa95f583d2c2a808736a))
121
+
122
+
123
+ - **(esdiff)** Create a command to determine problematic file (#3181) ([51c792e](https://github.com/swc-project/swc/commit/51c792eb302a4e22104912a1289d19f80610d480))
124
+
125
+ ### Miscellaneous Tasks
126
+
127
+
128
+
129
+ - **(*)** Update `rustc` (#3185) ([7d0a8a1](https://github.com/swc-project/swc/commit/7d0a8a12f145c42fba2ec6a80c4d9b720f29c40e))
130
+
131
+
132
+ - **(ci)** Split cargo docs (#3187) ([46949d3](https://github.com/swc-project/swc/commit/46949d39ebdcb14347156eb00490e53d37d06707))
133
+
134
+
135
+ - **(ci)** Fix publish scripts ([3458e9f](https://github.com/swc-project/swc/commit/3458e9f1d3eac7c47ba00a5768d3f8f41c8037ef))
136
+
137
+
138
+ - **(ci)** Fix publish scripts again ([b292126](https://github.com/swc-project/swc/commit/b292126b387c4efff0576517c7d706b16c08bca3))
139
+
140
+
141
+ - **(ci)** Fix `--cargo-flags` ([a20f5d9](https://github.com/swc-project/swc/commit/a20f5d9a7cd007d3c5fb671710d1344cd1577119))
142
+
143
+
144
+ - **(ci)** Use `--cargo-flags` in correct place ([ef4ea2f](https://github.com/swc-project/swc/commit/ef4ea2fc7b10ec50d317118680f58c70cf64c89b))
145
+
146
+
147
+ - **(ci)** Use `RUSTFLAGS` for linux ([4cbe8d1](https://github.com/swc-project/swc/commit/4cbe8d18bb10dfa8a333931767ebf958dab3bbae))
148
+
149
+
150
+ - **(ci)** Use more `RUSTFLAGS` ([bf0acd1](https://github.com/swc-project/swc/commit/bf0acd13da50a500414edbaf686a0632736f66fd))
151
+
152
+
153
+ - **(ci)** Fix musl ([fef8449](https://github.com/swc-project/swc/commit/fef844954b6aecd610c87ccb5ec30a2b08bd328a))
154
+
155
+
156
+ - **(ci)** Fix `aarch64-pc-windows-msvc` ([1ebbe62](https://github.com/swc-project/swc/commit/1ebbe622909a974abd0ea96929adee1c33f8f256))
157
+
158
+
159
+ - **(ci)** Change version of `rustc` ([d901b62](https://github.com/swc-project/swc/commit/d901b6222f8a77beed64968fcb4764bbacf8c755))
160
+
161
+
162
+ - **(ci)** Fix publish script (#3197) ([c34f1a9](https://github.com/swc-project/swc/commit/c34f1a977fac44813ebda5beb77b6444469e36e4))
163
+
164
+
165
+ - **(ci)** Remove redudant plugin test ([e19fe7d](https://github.com/swc-project/swc/commit/e19fe7d33b2a18c1b068c2f808f3ea72f1ccff15))
166
+
167
+ ### Refactor
168
+
169
+
170
+
171
+ - **(dbg-swc)** Rename `esdiff` to `dbg-swc` (#3189) ([c758997](https://github.com/swc-project/swc/commit/c758997180793502b76d737cf56ebc10b0d88004))
172
+
173
+
174
+ - **(plugin)** Add a loader for wasm-based plugin system (#3179) ([fc4c670](https://github.com/swc-project/swc/commit/fc4c6708f24cda39640fbbfe56123f2f6eeb2474))
175
+
176
+
177
+ - **(plugin)** Remove codes related to the plugin system based on `abi_stable` (#3188) ([32d3342](https://github.com/swc-project/swc/commit/32d3342283ec788842a89bf129e4f04cfab13eb6))
178
+
179
+
180
+ - **(plugin/runner)** Avoid redundant filesystem reads (#3186) ([b61c49f](https://github.com/swc-project/swc/commit/b61c49fe39acf28e09888e7b2163c7be5cceff4b))
181
+
182
+
183
+ - **(plugin/runner)** Replace wasm runtime (#3196) ([c3895ca](https://github.com/swc-project/swc/commit/c3895ca9aaf4c8b76f1eb1bf2c8655d8acb20b94))
184
+
185
+
186
+ - **(plugin/runner)** Reuse wasmer ([28ff059](https://github.com/swc-project/swc/commit/28ff0592a4005e89561500f915929ffa25da9160))
187
+
188
+ ## [1.2.126] - 2022-01-03
189
+
190
+ ### Bug Fixes
191
+
192
+
193
+
194
+ - **(es/minifier)** Fix comparison of objects, numbers and strings (#3172) ([db51ce4](https://github.com/swc-project/swc/commit/db51ce44614e3661c9c25c562d39b7581e521850))
195
+
196
+
197
+ - **(node-swc)** Recover from ldd not found ([1dfc2ee](https://github.com/swc-project/swc/commit/1dfc2ee1054d20b0d04699ebef3ab09b2f6fc4f8))
198
+
199
+ ### Features
200
+
201
+
202
+
203
+ - **(es/ast)** Add `ModuleExportName` (#3048) ([07c0489](https://github.com/swc-project/swc/commit/07c0489575188846b82b1af3e4bd711466e006ca))
204
+
205
+ ## [1.2.125] - 2022-01-02
206
+
207
+ ### Bug Fixes
208
+
209
+
210
+
8
211
  - **(es/compat)** Visit all private class methods (#3150) ([35b6461](https://github.com/swc-project/swc/commit/35b64613bb1f6de52d7362e66d28c50513dbbe12))
9
212
 
10
213
 
package/Visitor.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Accessibility, ArrayExpression, ArrayPattern, ArrowFunctionExpression, Argument, AssignmentExpression, AssignmentPattern, AssignmentPatternProperty, AssignmentProperty, AwaitExpression, BinaryExpression, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CatchClause, Class, ClassDeclaration, ClassExpression, ClassMember, ClassMethod, ClassProperty, ComputedPropName, ConditionalExpression, Constructor, ContinueStatement, DebuggerStatement, Declaration, Decorator, DefaultDecl, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDeclaration, ExportDefaultDeclaration, ExportDefaultExpression, ExportDefaultSpecifier, ExportNamedDeclaration, ExportNamespaceSpecifier, ExportSpecifier, Expression, ExpressionStatement, Fn, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, GetterProperty, Identifier, IfStatement, ImportDeclaration, ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier, JSXAttribute, JSXAttributeName, JSXAttributeOrSpread, JSXAttrValue, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementChild, JSXElementName, JSXEmptyExpression, JSXExpressionContainer, JSXFragment, JSXMemberExpression, JSXNamespacedName, JSXObject, JSXOpeningElement, JSXOpeningFragment, JSXSpreadChild, JSXText, KeyValuePatternProperty, KeyValueProperty, LabeledStatement, MemberExpression, MetaProperty, MethodProperty, Module, ModuleDeclaration, ModuleItem, NamedExportSpecifier, NamedImportSpecifier, NewExpression, NullLiteral, NumericLiteral, ObjectExpression, ObjectPattern, ObjectPatternProperty, OptionalChainingExpression, ParenthesisExpression, Pattern, PrivateMethod, PrivateName, PrivateProperty, Program, Property, PropertyName, RegExpLiteral, RestElement, ReturnStatement, Script, SequenceExpression, SetterProperty, SpreadElement, Statement, StringLiteral, Super, SwitchCase, SwitchStatement, TaggedTemplateExpression, TemplateLiteral, ThisExpression, ThrowStatement, TryStatement, TsAsExpression, TsEntityName, TsEnumDeclaration, TsEnumMember, TsEnumMemberId, TsExportAssignment, TsExpressionWithTypeArguments, TsExternalModuleReference, TsFnParameter, TsImportEqualsDeclaration, TsIndexSignature, TsInterfaceBody, TsInterfaceDeclaration, TsModuleBlock, TsModuleDeclaration, TsModuleName, TsModuleReference, TsNamespaceBody, TsNamespaceDeclaration, TsNamespaceExportDeclaration, TsNonNullExpression, TsParameterProperty, TsParameterPropertyParameter, TsQualifiedName, TsType, TsTypeAliasDeclaration, TsTypeAnnotation, TsTypeAssertion, TsTypeElement, TsTypeParameter, TsTypeParameterDeclaration, TsTypeParameterInstantiation, UnaryExpression, UpdateExpression, VariableDeclaration, VariableDeclarator, WhileStatement, WithStatement, YieldExpression, Param, ExprOrSpread, TsConstAssertion } from "./types";
1
+ import { Accessibility, ArrayExpression, ArrayPattern, ArrowFunctionExpression, Argument, AssignmentExpression, AssignmentPattern, AssignmentPatternProperty, AssignmentProperty, AwaitExpression, BinaryExpression, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CatchClause, Class, ClassDeclaration, ClassExpression, ClassMember, ClassMethod, ClassProperty, ComputedPropName, ConditionalExpression, Constructor, ContinueStatement, DebuggerStatement, Declaration, Decorator, DefaultDecl, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDeclaration, ExportDefaultDeclaration, ExportDefaultExpression, ExportDefaultSpecifier, ExportNamedDeclaration, ExportNamespaceSpecifier, ExportSpecifier, Expression, ExpressionStatement, Fn, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, GetterProperty, Identifier, IfStatement, ImportDeclaration, ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier, JSXAttribute, JSXAttributeName, JSXAttributeOrSpread, JSXAttrValue, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementChild, JSXElementName, JSXEmptyExpression, JSXExpressionContainer, JSXFragment, JSXMemberExpression, JSXNamespacedName, JSXObject, JSXOpeningElement, JSXOpeningFragment, JSXSpreadChild, JSXText, KeyValuePatternProperty, KeyValueProperty, LabeledStatement, MemberExpression, MetaProperty, MethodProperty, Module, ModuleDeclaration, ModuleItem, NamedExportSpecifier, NamedImportSpecifier, NewExpression, NullLiteral, NumericLiteral, ObjectExpression, ObjectPattern, ObjectPatternProperty, OptionalChainingExpression, ParenthesisExpression, Pattern, PrivateMethod, PrivateName, PrivateProperty, Program, Property, PropertyName, RegExpLiteral, RestElement, ReturnStatement, Script, SequenceExpression, SetterProperty, SpreadElement, Statement, StringLiteral, Super, SwitchCase, SwitchStatement, TaggedTemplateExpression, TemplateLiteral, ThisExpression, ThrowStatement, TryStatement, TsAsExpression, TsEntityName, TsEnumDeclaration, TsEnumMember, TsEnumMemberId, TsExportAssignment, TsExpressionWithTypeArguments, TsExternalModuleReference, TsFnParameter, TsImportEqualsDeclaration, TsIndexSignature, TsInterfaceBody, TsInterfaceDeclaration, TsModuleBlock, TsModuleDeclaration, TsModuleName, TsModuleReference, TsNamespaceBody, TsNamespaceDeclaration, TsNamespaceExportDeclaration, TsNonNullExpression, TsParameterProperty, TsParameterPropertyParameter, TsQualifiedName, TsType, TsTypeAliasDeclaration, TsTypeAnnotation, TsTypeAssertion, TsTypeElement, TsTypeParameter, TsTypeParameterDeclaration, TsTypeParameterInstantiation, UnaryExpression, UpdateExpression, VariableDeclaration, VariableDeclarator, WhileStatement, WithStatement, YieldExpression, Param, ExprOrSpread, TsConstAssertion, Import, SuperPropExpression } from "./types";
2
2
  export declare class Visitor {
3
3
  visitProgram(n: Program): Program;
4
4
  visitModule(m: Module): Module;
@@ -140,7 +140,8 @@ export declare class Visitor {
140
140
  visitArgument(n: Argument): Argument;
141
141
  visitMetaProperty(n: MetaProperty): Expression;
142
142
  visitMemberExpression(n: MemberExpression): Expression;
143
- visitExpressionOrSuper(n: Expression | Super): Expression | Super;
143
+ visitSuperPropExpression(n: SuperPropExpression): Expression;
144
+ visitCallee(n: Expression | Super | Import): Expression | Super | Import;
144
145
  visitJSXText(n: JSXText): JSXText;
145
146
  visitJSXNamespacedName(n: JSXNamespacedName): JSXNamespacedName;
146
147
  visitJSXMemberExpression(n: JSXMemberExpression): JSXMemberExpression;
package/Visitor.js CHANGED
@@ -730,6 +730,8 @@ class Visitor {
730
730
  return this.visitJSXText(n);
731
731
  case "MemberExpression":
732
732
  return this.visitMemberExpression(n);
733
+ case "SuperPropExpression":
734
+ return this.visitSuperPropExpression(n);
733
735
  case "MetaProperty":
734
736
  return this.visitMetaProperty(n);
735
737
  case "NewExpression":
@@ -955,17 +957,39 @@ class Visitor {
955
957
  return n;
956
958
  }
957
959
  visitMetaProperty(n) {
958
- n.meta = this.visitIdentifierReference(n.meta);
959
- n.property = this.visitIdentifier(n.property);
960
960
  return n;
961
961
  }
962
962
  visitMemberExpression(n) {
963
- n.object = this.visitExpressionOrSuper(n.object);
964
- n.property = this.visitExpression(n.property);
965
- return n;
963
+ n.object = this.visitExpression(n.object);
964
+ switch (n.property.type) {
965
+ case 'Computed': {
966
+ n.property = this.visitComputedPropertyKey(n.property);
967
+ return n;
968
+ }
969
+ case 'Identifier': {
970
+ n.property = this.visitIdentifier(n.property);
971
+ return n;
972
+ }
973
+ case 'PrivateName': {
974
+ n.property = this.visitPrivateName(n.property);
975
+ return n;
976
+ }
977
+ }
978
+ }
979
+ visitSuperPropExpression(n) {
980
+ switch (n.property.type) {
981
+ case 'Computed': {
982
+ n.property = this.visitComputedPropertyKey(n.property);
983
+ return n;
984
+ }
985
+ case 'Identifier': {
986
+ n.property = this.visitIdentifier(n.property);
987
+ return n;
988
+ }
989
+ }
966
990
  }
967
- visitExpressionOrSuper(n) {
968
- if (n.type === "Super") {
991
+ visitCallee(n) {
992
+ if (n.type === "Super" || n.type === "Import") {
969
993
  return n;
970
994
  }
971
995
  return this.visitExpression(n);
@@ -1116,7 +1140,7 @@ class Visitor {
1116
1140
  return n;
1117
1141
  }
1118
1142
  visitCallExpression(n) {
1119
- n.callee = this.visitExpressionOrSuper(n.callee);
1143
+ n.callee = this.visitCallee(n.callee);
1120
1144
  n.typeArguments = this.visitTsTypeParameterInstantiation(n.typeArguments);
1121
1145
  if (n.arguments) {
1122
1146
  n.arguments = this.visitArguments(n.arguments);
package/binding.js CHANGED
@@ -4,8 +4,16 @@ const { join } = require('path');
4
4
  const { platform, arch } = process;
5
5
  let nativeBinding = null;
6
6
  let localFileExisted = false;
7
- let isMusl = false;
8
7
  let loadError = null;
8
+ const isMusl = () => {
9
+ try {
10
+ const isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
11
+ return isMusl;
12
+ }
13
+ catch (e) {
14
+ return false;
15
+ }
16
+ };
9
17
  switch (platform) {
10
18
  case 'android':
11
19
  if (arch !== 'arm64') {
@@ -126,8 +134,7 @@ switch (platform) {
126
134
  case 'linux':
127
135
  switch (arch) {
128
136
  case 'x64':
129
- isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
130
- if (isMusl) {
137
+ if (isMusl()) {
131
138
  localFileExisted = existsSync(join(__dirname, 'swc.linux-x64-musl.node'));
132
139
  try {
133
140
  if (localFileExisted) {
@@ -157,8 +164,7 @@ switch (platform) {
157
164
  }
158
165
  break;
159
166
  case 'arm64':
160
- isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
161
- if (isMusl) {
167
+ if (isMusl()) {
162
168
  localFileExisted = existsSync(join(__dirname, 'swc.linux-arm64-musl.node'));
163
169
  try {
164
170
  if (localFileExisted) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/core",
3
- "version": "1.2.125",
3
+ "version": "1.2.129",
4
4
  "description": "Super-fast alternative for babel",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -51,19 +51,19 @@
51
51
  "@node-rs/helper": "^1.0.0"
52
52
  },
53
53
  "optionalDependencies": {
54
- "@swc/core-win32-x64-msvc": "1.2.125",
55
- "@swc/core-darwin-x64": "1.2.125",
56
- "@swc/core-linux-x64-gnu": "1.2.125",
57
- "@swc/core-linux-x64-musl": "1.2.125",
58
- "@swc/core-freebsd-x64": "1.2.125",
59
- "@swc/core-win32-ia32-msvc": "1.2.125",
60
- "@swc/core-linux-arm64-gnu": "1.2.125",
61
- "@swc/core-linux-arm-gnueabihf": "1.2.125",
62
- "@swc/core-darwin-arm64": "1.2.125",
63
- "@swc/core-android-arm64": "1.2.125",
64
- "@swc/core-linux-arm64-musl": "1.2.125",
65
- "@swc/core-win32-arm64-msvc": "1.2.125",
66
- "@swc/core-android-arm-eabi": "1.2.125"
54
+ "@swc/core-win32-x64-msvc": "1.2.129",
55
+ "@swc/core-darwin-x64": "1.2.129",
56
+ "@swc/core-linux-x64-gnu": "1.2.129",
57
+ "@swc/core-linux-x64-musl": "1.2.129",
58
+ "@swc/core-freebsd-x64": "1.2.129",
59
+ "@swc/core-win32-ia32-msvc": "1.2.129",
60
+ "@swc/core-linux-arm64-gnu": "1.2.129",
61
+ "@swc/core-linux-arm-gnueabihf": "1.2.129",
62
+ "@swc/core-darwin-arm64": "1.2.129",
63
+ "@swc/core-android-arm64": "1.2.129",
64
+ "@swc/core-linux-arm64-musl": "1.2.129",
65
+ "@swc/core-win32-arm64-msvc": "1.2.129",
66
+ "@swc/core-android-arm-eabi": "1.2.129"
67
67
  },
68
68
  "types": "./index.d.ts",
69
69
  "scripts": {
package/types.d.ts CHANGED
@@ -719,7 +719,7 @@ export interface VariableDeclarator extends Node, HasSpan {
719
719
  init?: Expression;
720
720
  definite: boolean;
721
721
  }
722
- export declare type Expression = ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | MemberExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier | Literal | TemplateLiteral | TaggedTemplateExpression | ArrowFunctionExpression | ClassExpression | YieldExpression | MetaProperty | AwaitExpression | ParenthesisExpression | JSXMemberExpression | JSXNamespacedName | JSXEmptyExpression | JSXElement | JSXFragment | TsTypeAssertion | TsConstAssertion | TsNonNullExpression | TsAsExpression | PrivateName | OptionalChainingExpression | Invalid;
722
+ export declare type Expression = ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | MemberExpression | SuperPropExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier | Literal | TemplateLiteral | TaggedTemplateExpression | ArrowFunctionExpression | ClassExpression | YieldExpression | MetaProperty | AwaitExpression | ParenthesisExpression | JSXMemberExpression | JSXNamespacedName | JSXEmptyExpression | JSXElement | JSXFragment | TsTypeAssertion | TsConstAssertion | TsNonNullExpression | TsAsExpression | PrivateName | OptionalChainingExpression | Invalid;
723
723
  interface ExpressionBase extends Node, HasSpan {
724
724
  }
725
725
  export interface OptionalChainingExpression extends ExpressionBase {
@@ -787,9 +787,13 @@ export interface AssignmentExpression extends ExpressionBase {
787
787
  }
788
788
  export interface MemberExpression extends ExpressionBase {
789
789
  type: "MemberExpression";
790
- object: Expression | Super;
791
- property: Expression;
792
- computed: boolean;
790
+ object: Expression;
791
+ property: Identifier | PrivateName | ComputedPropName;
792
+ }
793
+ export interface SuperPropExpression extends ExpressionBase {
794
+ type: "SuperPropExpression";
795
+ object: Super;
796
+ property: Identifier | ComputedPropName;
793
797
  }
794
798
  export interface ConditionalExpression extends ExpressionBase {
795
799
  type: "ConditionalExpression";
@@ -800,9 +804,12 @@ export interface ConditionalExpression extends ExpressionBase {
800
804
  export interface Super extends Node, HasSpan {
801
805
  type: "Super";
802
806
  }
807
+ export interface Import extends Node, HasSpan {
808
+ type: "Import";
809
+ }
803
810
  export interface CallExpression extends ExpressionBase {
804
811
  type: "CallExpression";
805
- callee: Expression | Super;
812
+ callee: Expression | Super | Import;
806
813
  arguments: Argument[];
807
814
  typeArguments?: TsTypeParameterInstantiation;
808
815
  }
@@ -832,8 +839,7 @@ export interface YieldExpression extends ExpressionBase {
832
839
  }
833
840
  export interface MetaProperty extends Node {
834
841
  type: "MetaProperty";
835
- meta: Identifier;
836
- property: Identifier;
842
+ kind: 'ImportMeta' | 'NewTarget';
837
843
  }
838
844
  export interface AwaitExpression extends ExpressionBase {
839
845
  type: "AwaitExpression";