-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ecmascript/transforms): Fix dce (#1301)
swc_bunder: - Fix `keywords` pass. swc_ecma_codegen: - Ensure that the code generator handles unicode characters properly. (denoland/deno#8925) swc_ecma_parser: - Ensure that the parser handles unicode characters properly. (denoland/deno#8925) swc_ecma_transforms: - Fix dce.
- Loading branch information
Showing
19 changed files
with
495 additions
and
62 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import * as React from "https://esm.sh/react@17.0.1" | ||
|
||
console.log(React) | ||
if (!React) { | ||
throw new Error() | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from "https://esm.sh/react@17.0.1" | ||
|
||
console.log(React) | ||
if (!React) { | ||
throw new Error() | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * as flags from 'https://deno.land/std@0.83.0/flags/mod.ts'; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { flags } from './deps.ts'; | ||
|
||
console.log(flags.parse(Deno.args)); |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'https://deno.land/std@0.82.0/flags/mod.ts'; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'https://deno.land/std@0.83.0/log/mod.ts'; |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class T { | ||
private throws: number[] = []; | ||
m(): void { | ||
console.log(this.throws.length); | ||
} | ||
} | ||
|
||
new T().m(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ const [a, b, c] = [ | |
3 | ||
]; | ||
const b1 = b; | ||
const b2 = b1; | ||
const mod = function() { | ||
return { | ||
b: b1 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const 𝒫 = 2; | ||
console.log(𝒫) |
116 changes: 116 additions & 0 deletions
116
ecmascript/parser/tests/typescript/deno-8925/case1/input.ts.json
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 |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"type": "Script", | ||
"span": { | ||
"start": 0, | ||
"end": 33, | ||
"ctxt": 0 | ||
}, | ||
"body": [ | ||
{ | ||
"type": "VariableDeclaration", | ||
"span": { | ||
"start": 0, | ||
"end": 15, | ||
"ctxt": 0 | ||
}, | ||
"kind": "const", | ||
"declare": false, | ||
"declarations": [ | ||
{ | ||
"type": "VariableDeclarator", | ||
"span": { | ||
"start": 6, | ||
"end": 14, | ||
"ctxt": 0 | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"span": { | ||
"start": 6, | ||
"end": 10, | ||
"ctxt": 0 | ||
}, | ||
"value": "𝒫", | ||
"typeAnnotation": null, | ||
"optional": false | ||
}, | ||
"init": { | ||
"type": "NumericLiteral", | ||
"span": { | ||
"start": 13, | ||
"end": 14, | ||
"ctxt": 0 | ||
}, | ||
"value": 2.0 | ||
}, | ||
"definite": false | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "ExpressionStatement", | ||
"span": { | ||
"start": 16, | ||
"end": 33, | ||
"ctxt": 0 | ||
}, | ||
"expression": { | ||
"type": "CallExpression", | ||
"span": { | ||
"start": 16, | ||
"end": 33, | ||
"ctxt": 0 | ||
}, | ||
"callee": { | ||
"type": "MemberExpression", | ||
"span": { | ||
"start": 16, | ||
"end": 27, | ||
"ctxt": 0 | ||
}, | ||
"object": { | ||
"type": "Identifier", | ||
"span": { | ||
"start": 16, | ||
"end": 23, | ||
"ctxt": 0 | ||
}, | ||
"value": "console", | ||
"typeAnnotation": null, | ||
"optional": false | ||
}, | ||
"property": { | ||
"type": "Identifier", | ||
"span": { | ||
"start": 24, | ||
"end": 27, | ||
"ctxt": 0 | ||
}, | ||
"value": "log", | ||
"typeAnnotation": null, | ||
"optional": false | ||
}, | ||
"computed": false | ||
}, | ||
"arguments": [ | ||
{ | ||
"spread": null, | ||
"expression": { | ||
"type": "Identifier", | ||
"span": { | ||
"start": 28, | ||
"end": 32, | ||
"ctxt": 0 | ||
}, | ||
"value": "𝒫", | ||
"typeAnnotation": null, | ||
"optional": false | ||
} | ||
} | ||
], | ||
"typeArguments": null | ||
} | ||
} | ||
], | ||
"interpreter": null | ||
} |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const 𝒫 = 2; | ||
console.log(𝒫) |
Oops, something went wrong.