-
-
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.
fix(es/minifier): Ignore using declarations (#9598)
- Loading branch information
Showing
126 changed files
with
961 additions
and
2,832 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
swc_core: patch | ||
swc_ecma_minifier: patch | ||
swc_ecma_transforms_optimization: patch | ||
--- | ||
|
||
chore(ci): Fix CI |
365 changes: 118 additions & 247 deletions
365
crates/swc/tests/tsc-references/awaitUsingDeclarations.1(target=esnext).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,267 +1,138 @@ | ||
//// [awaitUsingDeclarations.1.ts] | ||
import { _ as _using_ctx } from "@swc/helpers/_/_using_ctx"; | ||
try { | ||
var _usingCtx = _using_ctx(); | ||
var d1 = _usingCtx.a({ | ||
await using d1 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
async function af() { | ||
await using d3 = { | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
async function af() { | ||
try { | ||
var _usingCtx = _using_ctx(); | ||
const d3 = _usingCtx.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
await null; | ||
} catch (_) { | ||
_usingCtx.e = _; | ||
} finally{ | ||
await _usingCtx.d(); | ||
} | ||
} | ||
async function* ag() { | ||
try { | ||
var _usingCtx = _using_ctx(); | ||
const d5 = _usingCtx.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
yield; | ||
await null; | ||
} catch (_) { | ||
_usingCtx.e = _; | ||
} finally{ | ||
await _usingCtx.d(); | ||
; | ||
await null; | ||
} | ||
async function* ag() { | ||
await using d5 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
yield; | ||
await null; | ||
} | ||
const a = async ()=>{ | ||
await using d6 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
}; | ||
class C1 { | ||
async am() { | ||
await using d13 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
await null; | ||
} | ||
async *ag() { | ||
await using d15 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
yield; | ||
await null; | ||
} | ||
const a = async ()=>{ | ||
try { | ||
var _usingCtx = _using_ctx(); | ||
const d6 = _usingCtx.a({ | ||
constructor(){ | ||
this.a = async ()=>{ | ||
await using d7 = { | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx.e = _; | ||
} finally{ | ||
await _usingCtx.d(); | ||
} | ||
}; | ||
class C1 { | ||
async am() { | ||
try { | ||
var _usingCtx = _using_ctx(); | ||
const d13 = _usingCtx.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
await null; | ||
} catch (_) { | ||
_usingCtx.e = _; | ||
} finally{ | ||
await _usingCtx.d(); | ||
} | ||
} | ||
async *ag() { | ||
try { | ||
var _usingCtx = _using_ctx(); | ||
const d15 = _usingCtx.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
yield; | ||
await null; | ||
} catch (_) { | ||
_usingCtx.e = _; | ||
} finally{ | ||
await _usingCtx.d(); | ||
} | ||
} | ||
constructor(){ | ||
this.a = async ()=>{ | ||
try { | ||
var _usingCtx = _using_ctx(); | ||
const d7 = _usingCtx.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx.e = _; | ||
} finally{ | ||
await _usingCtx.d(); | ||
} | ||
}; | ||
} | ||
; | ||
}; | ||
} | ||
{ | ||
try { | ||
var _usingCtx1 = _using_ctx(); | ||
const d19 = _usingCtx1.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx1.e = _; | ||
} finally{ | ||
await _usingCtx1.d(); | ||
} | ||
{ | ||
await using d19 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
}switch(Math.random()){ | ||
case 0: | ||
await using d20 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
break; | ||
case 1: | ||
await using d21 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
break; | ||
} | ||
if (true) switch(0){ | ||
case 0: | ||
await using d22 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
break; | ||
} | ||
try { | ||
await using d23 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
switch(Math.random()){ | ||
case 0: | ||
try { | ||
var _usingCtx2 = _using_ctx(); | ||
const d20 = _usingCtx2.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
break; | ||
} catch (_) { | ||
_usingCtx2.e = _; | ||
} finally{ | ||
await _usingCtx2.d(); | ||
} | ||
case 1: | ||
try { | ||
var _usingCtx3 = _using_ctx(); | ||
const d21 = _usingCtx3.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
break; | ||
} catch (_) { | ||
_usingCtx3.e = _; | ||
} finally{ | ||
await _usingCtx3.d(); | ||
} | ||
; | ||
} catch { | ||
await using d24 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
if (true) switch(0){ | ||
case 0: | ||
try { | ||
var _usingCtx4 = _using_ctx(); | ||
const d22 = _usingCtx4.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
break; | ||
} catch (_) { | ||
_usingCtx4.e = _; | ||
} finally{ | ||
await _usingCtx4.d(); | ||
} | ||
; | ||
} finally{ | ||
await using d25 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
try { | ||
try { | ||
var _usingCtx5 = _using_ctx(); | ||
const d23 = _usingCtx5.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx5.e = _; | ||
} finally{ | ||
await _usingCtx5.d(); | ||
} | ||
} catch { | ||
try { | ||
var _usingCtx6 = _using_ctx(); | ||
const d24 = _usingCtx6.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx6.e = _; | ||
} finally{ | ||
await _usingCtx6.d(); | ||
} | ||
} finally{ | ||
try { | ||
var _usingCtx7 = _using_ctx(); | ||
const d25 = _usingCtx7.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx7.e = _; | ||
} finally{ | ||
await _usingCtx7.d(); | ||
} | ||
; | ||
} | ||
if (true) { | ||
await using d26 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
if (true) { | ||
try { | ||
var _usingCtx8 = _using_ctx(); | ||
const d26 = _usingCtx8.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx8.e = _; | ||
} finally{ | ||
await _usingCtx8.d(); | ||
} | ||
} else { | ||
try { | ||
var _usingCtx9 = _using_ctx(); | ||
const d27 = _usingCtx9.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx9.e = _; | ||
} finally{ | ||
await _usingCtx9.d(); | ||
} | ||
; | ||
} else { | ||
await using d27 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
while(true){ | ||
try { | ||
var _usingCtx10 = _using_ctx(); | ||
const d28 = _usingCtx10.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
break; | ||
} catch (_) { | ||
_usingCtx10.e = _; | ||
} finally{ | ||
await _usingCtx10.d(); | ||
} | ||
; | ||
} | ||
while(true){ | ||
await using d28 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
do { | ||
try { | ||
var _usingCtx11 = _using_ctx(); | ||
const d29 = _usingCtx11.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
break; | ||
} catch (_) { | ||
_usingCtx11.e = _; | ||
} finally{ | ||
await _usingCtx11.d(); | ||
} | ||
}while (true) | ||
for(;;){ | ||
try { | ||
var _usingCtx12 = _using_ctx(); | ||
const d30 = _usingCtx12.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
break; | ||
} catch (_) { | ||
_usingCtx12.e = _; | ||
} finally{ | ||
await _usingCtx12.d(); | ||
} | ||
; | ||
break; | ||
} | ||
do { | ||
await using d29 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
for(const x in {}){ | ||
try { | ||
var _usingCtx13 = _using_ctx(); | ||
const d31 = _usingCtx13.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx13.e = _; | ||
} finally{ | ||
await _usingCtx13.d(); | ||
} | ||
; | ||
break; | ||
}while (true) | ||
for(;;){ | ||
await using d30 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
for (const x of []){ | ||
try { | ||
var _usingCtx14 = _using_ctx(); | ||
const d32 = _usingCtx14.a({ | ||
async [Symbol.asyncDispose] () {} | ||
}); | ||
} catch (_) { | ||
_usingCtx14.e = _; | ||
} finally{ | ||
await _usingCtx14.d(); | ||
} | ||
; | ||
break; | ||
} | ||
for(const x in {}){ | ||
await using d31 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
} catch (_) { | ||
_usingCtx.e = _; | ||
} finally{ | ||
await _usingCtx.d(); | ||
; | ||
} | ||
for (const x of []){ | ||
await using d32 = { | ||
async [Symbol.asyncDispose] () {} | ||
} | ||
; | ||
} | ||
export { }; |
Oops, something went wrong.