mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
chore: upgrade crates based on deno ast 0.3 (#12403)
This commit is contained in:
parent
b1e7452cd3
commit
9b1f0c8ba3
16 changed files with 315 additions and 248 deletions
|
@ -35,9 +35,9 @@
|
||||||
"tools/wpt/manifest.json"
|
"tools/wpt/manifest.json"
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"https://plugins.dprint.dev/typescript-0.54.0.wasm",
|
"https://plugins.dprint.dev/typescript-0.57.1.wasm",
|
||||||
"https://plugins.dprint.dev/json-0.13.0.wasm",
|
"https://plugins.dprint.dev/json-0.13.0.wasm",
|
||||||
"https://plugins.dprint.dev/markdown-0.10.0.wasm",
|
"https://plugins.dprint.dev/markdown-0.10.0.wasm",
|
||||||
"https://plugins.dprint.dev/toml-0.5.1.wasm"
|
"https://plugins.dprint.dev/toml-0.5.2.wasm"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
190
Cargo.lock
generated
190
Cargo.lock
generated
|
@ -407,6 +407,15 @@ dependencies = [
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cloudabi"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "codespan-reporting"
|
name = "codespan-reporting"
|
||||||
version = "0.11.1"
|
version = "0.11.1"
|
||||||
|
@ -707,9 +716,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_ast"
|
name = "deno_ast"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "427e7091c1fd8a13b002824f43773b6ef2d5c8ded445ee20013bea7f6ca8bc5b"
|
checksum = "d177a5fbe88bec8d8b86882c77b7ba39ba03be99c5d80d3c9fc529191f3c0933"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"data-url",
|
"data-url",
|
||||||
"dprint-swc-ecma-ast-view",
|
"dprint-swc-ecma-ast-view",
|
||||||
|
@ -793,9 +802,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_doc"
|
name = "deno_doc"
|
||||||
version = "0.15.0"
|
version = "0.16.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cac0571321c463d3cfa39d03084c9f823bcc812daa7202eb2e89b5f9abd6301f"
|
checksum = "73fa23e7482a6bce5a6dfbcca145e247aa282ef002db0f9f060d0a812ac18ff3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"deno_ast",
|
"deno_ast",
|
||||||
|
@ -838,9 +847,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_graph"
|
name = "deno_graph"
|
||||||
version = "0.6.0"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1d856f43e3fd84399d9f90200708fdd5f507bb5ee43770a5a88b3dbdf667619e"
|
checksum = "a9adc8acfce4c311ebb4cd08a70d3149cf2cd157d468bd46bb5c556db0754eec"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
|
@ -873,9 +882,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_lint"
|
name = "deno_lint"
|
||||||
version = "0.16.0"
|
version = "0.17.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "32634706476ab0da1839d866b3f1765639afc894299bf96b83c980913c78275e"
|
checksum = "286985c2af9d4fcf162e2d5e08b196f68ab2f093ee6eaa28618842c47126c11d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"deno_ast",
|
"deno_ast",
|
||||||
|
@ -1142,13 +1151,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dprint-plugin-typescript"
|
name = "dprint-plugin-typescript"
|
||||||
version = "0.55.0"
|
version = "0.57.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0f893075573bad180d06bcc673996a128b09e9ab608c45e40c379fd733f85636"
|
checksum = "85bf1bad85eb81020904b4e80271ab760be7aef3b5edf8b82567f51c8b2c7cba"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dprint-core",
|
"dprint-core",
|
||||||
"dprint-swc-ecma-ast-view",
|
"dprint-swc-ecma-ast-view",
|
||||||
"fnv",
|
"parking_lot_core",
|
||||||
|
"rustc-hash",
|
||||||
"serde",
|
"serde",
|
||||||
"swc_common",
|
"swc_common",
|
||||||
"swc_ecmascript",
|
"swc_ecmascript",
|
||||||
|
@ -1156,13 +1166,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dprint-swc-ecma-ast-view"
|
name = "dprint-swc-ecma-ast-view"
|
||||||
version = "0.35.0"
|
version = "0.39.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c561abeae30e338748557e2c85e7c73621877eba137951207a3fd32306d9ce2"
|
checksum = "3530a71ad541e1182d19a1fa4da83c8d134e38f6fffd4cd1035440444dd08d15"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"fnv",
|
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
|
"rustc-hash",
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
"swc_common",
|
"swc_common",
|
||||||
"swc_ecmascript",
|
"swc_ecmascript",
|
||||||
|
@ -1327,7 +1337,7 @@ checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"redox_syscall 0.2.10",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2470,9 +2480,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
version = "0.11.2"
|
version = "0.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"instant",
|
"instant",
|
||||||
"lock_api",
|
"lock_api",
|
||||||
|
@ -2481,14 +2491,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot_core"
|
name = "parking_lot_core"
|
||||||
version = "0.8.5"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
|
checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 0.1.10",
|
||||||
|
"cloudabi",
|
||||||
"instant",
|
"instant",
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"redox_syscall 0.1.57",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
@ -2894,6 +2905,12 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "redox_syscall"
|
||||||
|
version = "0.1.57"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redox_syscall"
|
name = "redox_syscall"
|
||||||
version = "0.2.10"
|
version = "0.2.10"
|
||||||
|
@ -3545,18 +3562,17 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_bundler"
|
name = "swc_bundler"
|
||||||
version = "0.58.1"
|
version = "0.68.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "acfdeafdcfbfb0f4ca1838d775d8124da81168c4131a340c5b6682f078b34719"
|
checksum = "e39f8571be48d4397f9186d449ca9a435da3314dfe8db428f2485b8489ccbb53"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash 0.7.4",
|
"ahash 0.7.4",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"crc",
|
"crc",
|
||||||
"fxhash",
|
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"is-macro",
|
"is-macro",
|
||||||
"log",
|
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
"parking_lot",
|
||||||
"petgraph 0.5.1",
|
"petgraph 0.5.1",
|
||||||
"radix_fmt",
|
"radix_fmt",
|
||||||
"relative-path",
|
"relative-path",
|
||||||
|
@ -3567,42 +3583,44 @@ dependencies = [
|
||||||
"swc_ecma_codegen",
|
"swc_ecma_codegen",
|
||||||
"swc_ecma_loader",
|
"swc_ecma_loader",
|
||||||
"swc_ecma_parser",
|
"swc_ecma_parser",
|
||||||
"swc_ecma_transforms",
|
"swc_ecma_transforms_base",
|
||||||
|
"swc_ecma_transforms_optimization",
|
||||||
"swc_ecma_utils",
|
"swc_ecma_utils",
|
||||||
"swc_ecma_visit",
|
"swc_ecma_visit",
|
||||||
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_common"
|
name = "swc_common"
|
||||||
version = "0.12.2"
|
version = "0.13.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "acc9ad667d8c220e1625e189933ffd9d29b643317aca7a211db2600ef622879e"
|
checksum = "259212df9a949aa6ec440b64244475bcda531609a85489a22eb27908dd8d1b0d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash 0.7.4",
|
"ahash 0.7.4",
|
||||||
"ast_node",
|
"ast_node",
|
||||||
"cfg-if 0.1.10",
|
"cfg-if 0.1.10",
|
||||||
"either",
|
"either",
|
||||||
"from_variant",
|
"from_variant",
|
||||||
"fxhash",
|
|
||||||
"log",
|
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"owning_ref",
|
"owning_ref",
|
||||||
|
"rustc-hash",
|
||||||
"scoped-tls",
|
"scoped-tls",
|
||||||
"serde",
|
"serde",
|
||||||
"sourcemap",
|
"sourcemap",
|
||||||
"string_cache",
|
"string_cache",
|
||||||
"swc_eq_ignore_macros",
|
"swc_eq_ignore_macros",
|
||||||
"swc_visit",
|
"swc_visit",
|
||||||
|
"tracing",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_ast"
|
name = "swc_ecma_ast"
|
||||||
version = "0.52.0"
|
version = "0.54.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa0efb0e13ba6545e2b86336937e1641594f78c48484b85c2dc9582eaccb41e1"
|
checksum = "eae24a6603262822de50069ff72394b0d208267e5bd5298678ba6a79f670c40f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"is-macro",
|
"is-macro",
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
|
@ -3614,12 +3632,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_codegen"
|
name = "swc_ecma_codegen"
|
||||||
version = "0.70.5"
|
version = "0.74.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e08e335585f54f85fa910ab771660f69d809f8f70160d4cf912c9a855970db81"
|
checksum = "e2f84ab8cdd0395372a9b94d2938ee787d18e4d6805b5e11d26756c8410ef78d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
"memchr",
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
|
"once_cell",
|
||||||
"sourcemap",
|
"sourcemap",
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
"swc_common",
|
"swc_common",
|
||||||
|
@ -3630,9 +3650,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_codegen_macros"
|
name = "swc_ecma_codegen_macros"
|
||||||
version = "0.5.2"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "51af418026cb4ea588e2b15fa206c44e09a3184b718e12a0919729c7c3ad20d3"
|
checksum = "bdbf826c739281cdb3b3c23883fd1a7586ea1c15b1287530e7123a7fad8f0e25"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pmutil",
|
"pmutil",
|
||||||
"proc-macro2 1.0.29",
|
"proc-macro2 1.0.29",
|
||||||
|
@ -3643,9 +3663,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_dep_graph"
|
name = "swc_ecma_dep_graph"
|
||||||
version = "0.39.1"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c20a594158fbaa00e039867f96183e4daa5a867fa21331a3655c90789f2df6b3"
|
checksum = "8e27fde9ec4d2b24663836ac0bff26909db0505abad3b873d30808f7659d977a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
"swc_common",
|
"swc_common",
|
||||||
|
@ -3655,30 +3675,28 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_loader"
|
name = "swc_ecma_loader"
|
||||||
version = "0.18.2"
|
version = "0.21.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c2f718f0335f9ab7437fecf9f3d73ae6a24c03a3d3f46910a68261703d407f03"
|
checksum = "8a1c79e93e0182da35ab5be1fcb6e8060b5af41bf4e9c1760cad3520dbc287ac"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"ahash 0.7.4",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"fxhash",
|
|
||||||
"log",
|
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
"swc_common",
|
"swc_common",
|
||||||
"swc_ecma_ast",
|
"swc_ecma_ast",
|
||||||
"swc_ecma_visit",
|
"swc_ecma_visit",
|
||||||
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_parser"
|
name = "swc_ecma_parser"
|
||||||
version = "0.70.4"
|
version = "0.73.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "04b2e3c0ac2132a7ab0679fe8bb89ad0a3311c6c5f44a22bffc559647e1f2e47"
|
checksum = "c8d7c0925ea8ad9ca8554ed668ab8cf98e057064a79a819893f71a008cd65e36"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
"enum_kind",
|
"enum_kind",
|
||||||
"fxhash",
|
|
||||||
"lexical",
|
"lexical",
|
||||||
"log",
|
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"serde",
|
"serde",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
|
@ -3686,21 +3704,21 @@ dependencies = [
|
||||||
"swc_common",
|
"swc_common",
|
||||||
"swc_ecma_ast",
|
"swc_ecma_ast",
|
||||||
"swc_ecma_visit",
|
"swc_ecma_visit",
|
||||||
|
"tracing",
|
||||||
"unicode-xid 0.2.2",
|
"unicode-xid 0.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_transforms"
|
name = "swc_ecma_transforms"
|
||||||
version = "0.71.1"
|
version = "0.81.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b2124504a4203cab8f903b8e8be49dbd6c4bad2b0405ba0c8188f952c224c44b"
|
checksum = "9170807286d86c713320a5122c299a5cd62c81ac62e572e2259aa1a93d80c171"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
"swc_common",
|
"swc_common",
|
||||||
"swc_ecma_ast",
|
"swc_ecma_ast",
|
||||||
"swc_ecma_parser",
|
"swc_ecma_parser",
|
||||||
"swc_ecma_transforms_base",
|
"swc_ecma_transforms_base",
|
||||||
"swc_ecma_transforms_optimization",
|
|
||||||
"swc_ecma_transforms_proposal",
|
"swc_ecma_transforms_proposal",
|
||||||
"swc_ecma_transforms_react",
|
"swc_ecma_transforms_react",
|
||||||
"swc_ecma_transforms_typescript",
|
"swc_ecma_transforms_typescript",
|
||||||
|
@ -3711,11 +3729,10 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_transforms_base"
|
name = "swc_ecma_transforms_base"
|
||||||
version = "0.31.4"
|
version = "0.37.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fdcd1f3c1ca665605dcb2a7d6b536aeff1ed1da2eeebf32238d890e42b494312"
|
checksum = "e5ab2108361a8bb8664951ae0f533fab36c609aa849143b3358e29ed33060bbe"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fxhash",
|
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"phf",
|
"phf",
|
||||||
"scoped-tls",
|
"scoped-tls",
|
||||||
|
@ -3730,9 +3747,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_transforms_classes"
|
name = "swc_ecma_transforms_classes"
|
||||||
version = "0.17.1"
|
version = "0.23.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ad5a845d5ec140ba8580c6b8d0f51ce417b86395a7b74c4280bb6cdae3c042c6"
|
checksum = "cafd0ad50aedf503cd640c0a3b5a9e9c0a8a279c1772c523f78ee707f30d3423"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
"swc_common",
|
"swc_common",
|
||||||
|
@ -3743,15 +3760,27 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_transforms_optimization"
|
name = "swc_ecma_transforms_macros"
|
||||||
version = "0.41.1"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ea2600bc3bd557353511cd90b336943ae30e8807bce989a420cb004953fb940a"
|
checksum = "f7680ada61fa22c2164c3f32864efba31566710b503c30631ccc3b6f0fa800bc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.29",
|
||||||
|
"quote 1.0.10",
|
||||||
|
"swc_macros_common",
|
||||||
|
"syn 1.0.65",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_ecma_transforms_optimization"
|
||||||
|
version = "0.51.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cc478afa98cd8272d75a994cddd598f903cc8c9d0fce6555516dcad0ed2a0c61"
|
||||||
|
dependencies = [
|
||||||
|
"ahash 0.7.4",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"fxhash",
|
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"log",
|
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"retain_mut",
|
"retain_mut",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -3762,16 +3791,16 @@ dependencies = [
|
||||||
"swc_ecma_transforms_base",
|
"swc_ecma_transforms_base",
|
||||||
"swc_ecma_utils",
|
"swc_ecma_utils",
|
||||||
"swc_ecma_visit",
|
"swc_ecma_visit",
|
||||||
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_transforms_proposal"
|
name = "swc_ecma_transforms_proposal"
|
||||||
version = "0.38.1"
|
version = "0.46.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "637093e49ee993b16fb7bf8918f3d409c986fc77850440a3c779de85d1442cfb"
|
checksum = "cdb257ed97c73338e9776a0c1404bc55570d14e69d0b57f1030105630dd36a5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
"fxhash",
|
|
||||||
"serde",
|
"serde",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
|
@ -3780,16 +3809,18 @@ dependencies = [
|
||||||
"swc_ecma_parser",
|
"swc_ecma_parser",
|
||||||
"swc_ecma_transforms_base",
|
"swc_ecma_transforms_base",
|
||||||
"swc_ecma_transforms_classes",
|
"swc_ecma_transforms_classes",
|
||||||
|
"swc_ecma_transforms_macros",
|
||||||
"swc_ecma_utils",
|
"swc_ecma_utils",
|
||||||
"swc_ecma_visit",
|
"swc_ecma_visit",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_transforms_react"
|
name = "swc_ecma_transforms_react"
|
||||||
version = "0.39.1"
|
version = "0.48.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "18bf8799eb49b25f0632b9e60b7871b3f77e18fecb1972e4932ba08005b5c85f"
|
checksum = "4c30996f62170b3cad11ac85dc058c59655d66a6de134d3182e99324c903da58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"ahash 0.7.4",
|
||||||
"base64 0.13.0",
|
"base64 0.13.0",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
|
@ -3809,11 +3840,10 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_transforms_typescript"
|
name = "swc_ecma_transforms_typescript"
|
||||||
version = "0.40.4"
|
version = "0.48.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "96bb017f32fd1559f10245112eeac1cf10e3b76415495e159b10c82ee667ac9e"
|
checksum = "62b8ba9d4bc21426d3b21e92c6007932f421dd4698d4e301352ff7e969c72295"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fxhash",
|
|
||||||
"serde",
|
"serde",
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
"swc_common",
|
"swc_common",
|
||||||
|
@ -3826,9 +3856,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_utils"
|
name = "swc_ecma_utils"
|
||||||
version = "0.44.2"
|
version = "0.47.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c811bca37142f7fe21ce800784db1d537645762ffe8d8a52e2a7179d8cc1723"
|
checksum = "e3e427f476cd95fa625678d2df2c8a56ad94ce4182034f9489f9249f3f1c7c9f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"scoped-tls",
|
"scoped-tls",
|
||||||
|
@ -3841,9 +3871,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecma_visit"
|
name = "swc_ecma_visit"
|
||||||
version = "0.38.1"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "78c6721dfbcb8bea64383edb0d59ccb02bc1e140024f2e0f8766792a14f5f466"
|
checksum = "2c24a7600061813d7df3248d93ff27cacc1a81f9eeec47701866f3adc9ae2930"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"swc_atoms",
|
"swc_atoms",
|
||||||
|
@ -3854,9 +3884,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "swc_ecmascript"
|
name = "swc_ecmascript"
|
||||||
version = "0.63.1"
|
version = "0.73.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ba53c5582d6e5881b093ece9aaa4b561465afab0560abb19948f2c4bbff1bdb9"
|
checksum = "8147c047015f4289b3202a5362a6ed8c384a585eee05c98f040299a0b303f22e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"swc_ecma_ast",
|
"swc_ecma_ast",
|
||||||
"swc_ecma_codegen",
|
"swc_ecma_codegen",
|
||||||
|
@ -3968,7 +3998,7 @@ dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"libc",
|
"libc",
|
||||||
"rand 0.8.4",
|
"rand 0.8.4",
|
||||||
"redox_syscall",
|
"redox_syscall 0.2.10",
|
||||||
"remove_dir_all",
|
"remove_dir_all",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
@ -4189,9 +4219,21 @@ checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
|
"tracing-attributes",
|
||||||
"tracing-core",
|
"tracing-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracing-attributes"
|
||||||
|
version = "0.1.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 1.0.29",
|
||||||
|
"quote 1.0.10",
|
||||||
|
"syn 1.0.65",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing-core"
|
name = "tracing-core"
|
||||||
version = "0.1.21"
|
version = "0.1.21"
|
||||||
|
|
|
@ -39,11 +39,11 @@ winapi = "0.3.9"
|
||||||
winres = "0.1.11"
|
winres = "0.1.11"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
deno_ast = { version = "0.2.0", features = ["bundler", "codegen", "dep_graph", "module_specifier", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
|
deno_ast = { version = "0.3.0", features = ["bundler", "codegen", "dep_graph", "module_specifier", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
|
||||||
deno_core = { version = "0.102.0", path = "../core" }
|
deno_core = { version = "0.102.0", path = "../core" }
|
||||||
deno_doc = "0.15.0"
|
deno_doc = "0.16.0"
|
||||||
deno_graph = "0.6.0"
|
deno_graph = "0.7.0"
|
||||||
deno_lint = { version = "0.16.0", features = ["docs"] }
|
deno_lint = { version = "0.17.0", features = ["docs"] }
|
||||||
deno_runtime = { version = "0.28.0", path = "../runtime" }
|
deno_runtime = { version = "0.28.0", path = "../runtime" }
|
||||||
deno_tls = { version = "0.7.0", path = "../ext/tls" }
|
deno_tls = { version = "0.7.0", path = "../ext/tls" }
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ data-url = "0.1.0"
|
||||||
dissimilar = "1.0.2"
|
dissimilar = "1.0.2"
|
||||||
dprint-plugin-json = "0.13.0"
|
dprint-plugin-json = "0.13.0"
|
||||||
dprint-plugin-markdown = "0.10.0"
|
dprint-plugin-markdown = "0.10.0"
|
||||||
dprint-plugin-typescript = "0.55.0"
|
dprint-plugin-typescript = "0.57.2"
|
||||||
encoding_rs = "0.8.28"
|
encoding_rs = "0.8.28"
|
||||||
env_logger = "0.8.4"
|
env_logger = "0.8.4"
|
||||||
fancy-regex = "0.7.1"
|
fancy-regex = "0.7.1"
|
||||||
|
|
|
@ -13,6 +13,7 @@ use deno_ast::swc::common::comments::SingleThreadedComments;
|
||||||
use deno_ast::swc::common::BytePos;
|
use deno_ast::swc::common::BytePos;
|
||||||
use deno_ast::swc::common::FileName;
|
use deno_ast::swc::common::FileName;
|
||||||
use deno_ast::swc::common::Globals;
|
use deno_ast::swc::common::Globals;
|
||||||
|
use deno_ast::swc::common::Mark;
|
||||||
use deno_ast::swc::common::SourceMap;
|
use deno_ast::swc::common::SourceMap;
|
||||||
use deno_ast::swc::common::Spanned;
|
use deno_ast::swc::common::Spanned;
|
||||||
use deno_ast::swc::parser::lexer::Lexer;
|
use deno_ast::swc::parser::lexer::Lexer;
|
||||||
|
@ -23,6 +24,7 @@ use deno_ast::swc::transforms::hygiene;
|
||||||
use deno_ast::swc::transforms::pass::Optional;
|
use deno_ast::swc::transforms::pass::Optional;
|
||||||
use deno_ast::swc::transforms::proposals;
|
use deno_ast::swc::transforms::proposals;
|
||||||
use deno_ast::swc::transforms::react;
|
use deno_ast::swc::transforms::react;
|
||||||
|
use deno_ast::swc::transforms::resolver_with_mark;
|
||||||
use deno_ast::swc::transforms::typescript;
|
use deno_ast::swc::transforms::typescript;
|
||||||
use deno_ast::swc::visit::FoldWith;
|
use deno_ast::swc::visit::FoldWith;
|
||||||
use deno_ast::Diagnostic;
|
use deno_ast::Diagnostic;
|
||||||
|
@ -214,8 +216,12 @@ pub fn transpile(
|
||||||
source_map
|
source_map
|
||||||
.new_source_file(file_name, parsed_source.source().text().to_string());
|
.new_source_file(file_name, parsed_source.source().text().to_string());
|
||||||
let comments = parsed_source.comments().as_single_threaded(); // needs to be mutable
|
let comments = parsed_source.comments().as_single_threaded(); // needs to be mutable
|
||||||
|
let globals = Globals::new();
|
||||||
let jsx_pass = react::react(
|
deno_ast::swc::common::GLOBALS.set(&globals, || {
|
||||||
|
let top_level_mark = Mark::fresh(Mark::root());
|
||||||
|
let jsx_pass = chain!(
|
||||||
|
resolver_with_mark(top_level_mark),
|
||||||
|
react::react(
|
||||||
source_map.clone(),
|
source_map.clone(),
|
||||||
Some(&comments),
|
Some(&comments),
|
||||||
react::Options {
|
react::Options {
|
||||||
|
@ -226,6 +232,8 @@ pub fn transpile(
|
||||||
use_builtins: true,
|
use_builtins: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
|
top_level_mark,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
let mut passes = chain!(
|
let mut passes = chain!(
|
||||||
Optional::new(jsx_pass, options.transform_jsx),
|
Optional::new(jsx_pass, options.transform_jsx),
|
||||||
|
@ -235,7 +243,6 @@ pub fn transpile(
|
||||||
legacy: true,
|
legacy: true,
|
||||||
emit_metadata: options.emit_metadata
|
emit_metadata: options.emit_metadata
|
||||||
}),
|
}),
|
||||||
// DownlevelImportsFolder::new(), // todo: make this conditional
|
|
||||||
helpers::inject_helpers(),
|
helpers::inject_helpers(),
|
||||||
typescript::strip::strip_with_config(strip_config_from_emit_options(
|
typescript::strip::strip_with_config(strip_config_from_emit_options(
|
||||||
options
|
options
|
||||||
|
@ -244,10 +251,8 @@ pub fn transpile(
|
||||||
hygiene(),
|
hygiene(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let program = deno_ast::swc::common::GLOBALS.set(&Globals::new(), || {
|
let program = helpers::HELPERS.set(&helpers::Helpers::new(false), || {
|
||||||
helpers::HELPERS.set(&helpers::Helpers::new(false), || {
|
|
||||||
program.fold_with(&mut passes)
|
program.fold_with(&mut passes)
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut src_map_buf = vec![];
|
let mut src_map_buf = vec![];
|
||||||
|
@ -285,6 +290,7 @@ pub fn transpile(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok((src, map))
|
Ok((src, map))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A low level function which transpiles a source module into an swc
|
/// A low level function which transpiles a source module into an swc
|
||||||
|
@ -317,7 +323,11 @@ pub fn transpile_module(
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let jsx_pass = react::react(
|
deno_ast::swc::common::GLOBALS.set(globals, || {
|
||||||
|
let top_level_mark = Mark::fresh(Mark::root());
|
||||||
|
let jsx_pass = chain!(
|
||||||
|
resolver_with_mark(top_level_mark),
|
||||||
|
react::react(
|
||||||
cm,
|
cm,
|
||||||
Some(&comments),
|
Some(&comments),
|
||||||
react::Options {
|
react::Options {
|
||||||
|
@ -328,6 +338,8 @@ pub fn transpile_module(
|
||||||
use_builtins: true,
|
use_builtins: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
|
top_level_mark,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
let mut passes = chain!(
|
let mut passes = chain!(
|
||||||
Optional::new(jsx_pass, emit_options.transform_jsx),
|
Optional::new(jsx_pass, emit_options.transform_jsx),
|
||||||
|
@ -342,13 +354,12 @@ pub fn transpile_module(
|
||||||
fixer(Some(&comments)),
|
fixer(Some(&comments)),
|
||||||
);
|
);
|
||||||
|
|
||||||
let module = deno_ast::swc::common::GLOBALS.set(globals, || {
|
let module = helpers::HELPERS.set(&helpers::Helpers::new(false), || {
|
||||||
helpers::HELPERS.set(&helpers::Helpers::new(false), || {
|
|
||||||
module.fold_with(&mut passes)
|
module.fold_with(&mut passes)
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok((source_file, module))
|
Ok((source_file, module))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -385,6 +396,7 @@ mod tests {
|
||||||
media_type: deno_ast::MediaType::TypeScript,
|
media_type: deno_ast::MediaType::TypeScript,
|
||||||
capture_tokens: false,
|
capture_tokens: false,
|
||||||
maybe_syntax: None,
|
maybe_syntax: None,
|
||||||
|
scope_analysis: false,
|
||||||
})
|
})
|
||||||
.expect("could not parse module");
|
.expect("could not parse module");
|
||||||
let (code, maybe_map) = transpile(&module, &EmitOptions::default())
|
let (code, maybe_map) = transpile(&module, &EmitOptions::default())
|
||||||
|
@ -413,6 +425,7 @@ mod tests {
|
||||||
media_type: deno_ast::MediaType::Tsx,
|
media_type: deno_ast::MediaType::Tsx,
|
||||||
capture_tokens: false,
|
capture_tokens: false,
|
||||||
maybe_syntax: None,
|
maybe_syntax: None,
|
||||||
|
scope_analysis: true, // ensure scope analysis doesn't conflict with a second resolver pass
|
||||||
})
|
})
|
||||||
.expect("could not parse module");
|
.expect("could not parse module");
|
||||||
let (code, _) = transpile(&module, &EmitOptions::default())
|
let (code, _) = transpile(&module, &EmitOptions::default())
|
||||||
|
@ -448,6 +461,7 @@ mod tests {
|
||||||
media_type: deno_ast::MediaType::TypeScript,
|
media_type: deno_ast::MediaType::TypeScript,
|
||||||
capture_tokens: false,
|
capture_tokens: false,
|
||||||
maybe_syntax: None,
|
maybe_syntax: None,
|
||||||
|
scope_analysis: false,
|
||||||
})
|
})
|
||||||
.expect("could not parse module");
|
.expect("could not parse module");
|
||||||
let (code, _) = transpile(&module, &EmitOptions::default())
|
let (code, _) = transpile(&module, &EmitOptions::default())
|
||||||
|
|
|
@ -199,15 +199,10 @@ pub fn get_lint_references(
|
||||||
parsed_source: &deno_ast::ParsedSource,
|
parsed_source: &deno_ast::ParsedSource,
|
||||||
maybe_lint_config: Option<&LintConfig>,
|
maybe_lint_config: Option<&LintConfig>,
|
||||||
) -> Result<Vec<Reference>, AnyError> {
|
) -> Result<Vec<Reference>, AnyError> {
|
||||||
let syntax = deno_ast::get_syntax(parsed_source.media_type());
|
|
||||||
let lint_rules =
|
let lint_rules =
|
||||||
get_configured_rules(maybe_lint_config, vec![], vec![], vec![])?;
|
get_configured_rules(maybe_lint_config, vec![], vec![], vec![])?;
|
||||||
let linter = create_linter(syntax, lint_rules);
|
let linter = create_linter(parsed_source.media_type(), lint_rules);
|
||||||
// TODO(dsherret): do not re-parse here again
|
let lint_diagnostics = linter.lint_with_ast(parsed_source);
|
||||||
let (_, lint_diagnostics) = linter.lint(
|
|
||||||
parsed_source.specifier().to_string(),
|
|
||||||
parsed_source.source().text_str().to_string(),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
Ok(
|
Ok(
|
||||||
lint_diagnostics
|
lint_diagnostics
|
||||||
|
@ -357,6 +352,7 @@ pub fn parse_module(
|
||||||
// capture the tokens for linting and formatting
|
// capture the tokens for linting and formatting
|
||||||
capture_tokens: true,
|
capture_tokens: true,
|
||||||
maybe_syntax: None,
|
maybe_syntax: None,
|
||||||
|
scope_analysis: true, // for deno_lint
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ use crate::fmt_errors;
|
||||||
use crate::fs_util::{collect_files, is_supported_ext};
|
use crate::fs_util::{collect_files, is_supported_ext};
|
||||||
use crate::tools::fmt::run_parallelized;
|
use crate::tools::fmt::run_parallelized;
|
||||||
use crate::{colors, file_watcher};
|
use crate::{colors, file_watcher};
|
||||||
use deno_ast::swc::parser::Syntax;
|
|
||||||
use deno_ast::MediaType;
|
use deno_ast::MediaType;
|
||||||
use deno_core::error::{anyhow, generic_error, AnyError, JsStackFrame};
|
use deno_core::error::{anyhow, generic_error, AnyError, JsStackFrame};
|
||||||
use deno_core::serde_json;
|
use deno_core::serde_json;
|
||||||
|
@ -231,27 +230,26 @@ pub fn print_rules_list(json: bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_linter(
|
pub fn create_linter(
|
||||||
syntax: Syntax,
|
media_type: MediaType,
|
||||||
rules: Arc<Vec<Box<dyn LintRule>>>,
|
rules: Vec<Arc<dyn LintRule>>,
|
||||||
) -> Linter {
|
) -> Linter {
|
||||||
LinterBuilder::default()
|
LinterBuilder::default()
|
||||||
.ignore_file_directive("deno-lint-ignore-file")
|
.ignore_file_directive("deno-lint-ignore-file")
|
||||||
.ignore_diagnostic_directive("deno-lint-ignore")
|
.ignore_diagnostic_directive("deno-lint-ignore")
|
||||||
.syntax(syntax)
|
.media_type(media_type)
|
||||||
.rules(rules)
|
.rules(rules)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lint_file(
|
fn lint_file(
|
||||||
file_path: PathBuf,
|
file_path: PathBuf,
|
||||||
lint_rules: Arc<Vec<Box<dyn LintRule>>>,
|
lint_rules: Vec<Arc<dyn LintRule>>,
|
||||||
) -> Result<(Vec<LintDiagnostic>, String), AnyError> {
|
) -> Result<(Vec<LintDiagnostic>, String), AnyError> {
|
||||||
let file_name = file_path.to_string_lossy().to_string();
|
let file_name = file_path.to_string_lossy().to_string();
|
||||||
let source_code = fs::read_to_string(&file_path)?;
|
let source_code = fs::read_to_string(&file_path)?;
|
||||||
let media_type = MediaType::from(&file_path);
|
let media_type = MediaType::from(&file_path);
|
||||||
let syntax = deno_ast::get_syntax(media_type);
|
|
||||||
|
|
||||||
let linter = create_linter(syntax, lint_rules);
|
let linter = create_linter(media_type, lint_rules);
|
||||||
|
|
||||||
let (_, file_diagnostics) = linter.lint(file_name, source_code.clone())?;
|
let (_, file_diagnostics) = linter.lint(file_name, source_code.clone())?;
|
||||||
|
|
||||||
|
@ -262,15 +260,14 @@ fn lint_file(
|
||||||
/// Treats input as TypeScript.
|
/// Treats input as TypeScript.
|
||||||
/// Compatible with `--json` flag.
|
/// Compatible with `--json` flag.
|
||||||
fn lint_stdin(
|
fn lint_stdin(
|
||||||
lint_rules: Arc<Vec<Box<dyn LintRule>>>,
|
lint_rules: Vec<Arc<dyn LintRule>>,
|
||||||
) -> Result<(Vec<LintDiagnostic>, String), AnyError> {
|
) -> Result<(Vec<LintDiagnostic>, String), AnyError> {
|
||||||
let mut source_code = String::new();
|
let mut source_code = String::new();
|
||||||
if stdin().read_to_string(&mut source_code).is_err() {
|
if stdin().read_to_string(&mut source_code).is_err() {
|
||||||
return Err(generic_error("Failed to read from stdin"));
|
return Err(generic_error("Failed to read from stdin"));
|
||||||
}
|
}
|
||||||
|
|
||||||
let syntax = deno_ast::get_syntax(MediaType::TypeScript);
|
let linter = create_linter(MediaType::TypeScript, lint_rules);
|
||||||
let linter = create_linter(syntax, lint_rules);
|
|
||||||
|
|
||||||
let (_, file_diagnostics) =
|
let (_, file_diagnostics) =
|
||||||
linter.lint(STDIN_FILE_NAME.to_string(), source_code.clone())?;
|
linter.lint(STDIN_FILE_NAME.to_string(), source_code.clone())?;
|
||||||
|
@ -489,7 +486,7 @@ pub(crate) fn get_configured_rules(
|
||||||
rules_tags: Vec<String>,
|
rules_tags: Vec<String>,
|
||||||
rules_include: Vec<String>,
|
rules_include: Vec<String>,
|
||||||
rules_exclude: Vec<String>,
|
rules_exclude: Vec<String>,
|
||||||
) -> Result<Arc<Vec<Box<dyn LintRule>>>, AnyError> {
|
) -> Result<Vec<Arc<dyn LintRule>>, AnyError> {
|
||||||
if maybe_lint_config.is_none()
|
if maybe_lint_config.is_none()
|
||||||
&& rules_tags.is_empty()
|
&& rules_tags.is_empty()
|
||||||
&& rules_include.is_empty()
|
&& rules_include.is_empty()
|
||||||
|
|
|
@ -655,6 +655,7 @@ impl ReplSession {
|
||||||
media_type: deno_ast::MediaType::TypeScript,
|
media_type: deno_ast::MediaType::TypeScript,
|
||||||
capture_tokens: false,
|
capture_tokens: false,
|
||||||
maybe_syntax: None,
|
maybe_syntax: None,
|
||||||
|
scope_analysis: false,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let transpiled_src = transpile(
|
let transpiled_src = transpile(
|
||||||
|
|
|
@ -566,6 +566,7 @@ fn extract_files_from_source_comments(
|
||||||
media_type,
|
media_type,
|
||||||
capture_tokens: false,
|
capture_tokens: false,
|
||||||
maybe_syntax: None,
|
maybe_syntax: None,
|
||||||
|
scope_analysis: false,
|
||||||
})?;
|
})?;
|
||||||
let comments = parsed_source.comments().get_vec();
|
let comments = parsed_source.comments().get_vec();
|
||||||
let blocks_regex = Regex::new(r"```([^\n]*)\n([\S\s]*?)```")?;
|
let blocks_regex = Regex::new(r"```([^\n]*)\n([\S\s]*?)```")?;
|
||||||
|
|
|
@ -978,7 +978,7 @@
|
||||||
symbolKeys,
|
symbolKeys,
|
||||||
(s1, s2) =>
|
(s1, s2) =>
|
||||||
StringPrototypeLocaleCompare(
|
StringPrototypeLocaleCompare(
|
||||||
(s1.description ?? ""),
|
s1.description ?? "",
|
||||||
s2.description ?? "",
|
s2.description ?? "",
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
if (idlType === "BufferSource" && idlValue) {
|
if (idlType === "BufferSource" && idlValue) {
|
||||||
normalizedAlgorithm[member] = TypedArrayPrototypeSlice(
|
normalizedAlgorithm[member] = TypedArrayPrototypeSlice(
|
||||||
new Uint8Array(
|
new Uint8Array(
|
||||||
(ArrayBufferIsView(idlValue) ? idlValue.buffer : idlValue),
|
ArrayBufferIsView(idlValue) ? idlValue.buffer : idlValue,
|
||||||
idlValue.byteOffset ?? 0,
|
idlValue.byteOffset ?? 0,
|
||||||
idlValue.byteLength,
|
idlValue.byteLength,
|
||||||
),
|
),
|
||||||
|
|
|
@ -266,7 +266,7 @@
|
||||||
StringPrototypeReplace(
|
StringPrototypeReplace(
|
||||||
StringPrototypeReplace(
|
StringPrototypeReplace(
|
||||||
StringPrototypeReplace(
|
StringPrototypeReplace(
|
||||||
(isFilename ? str : StringPrototypeReplace(str, /\r?\n|\r/g, "\r\n")),
|
isFilename ? str : StringPrototypeReplace(str, /\r?\n|\r/g, "\r\n"),
|
||||||
/\n/g,
|
/\n/g,
|
||||||
"%0A",
|
"%0A",
|
||||||
),
|
),
|
||||||
|
|
|
@ -294,7 +294,6 @@ pub(crate) fn format_error(e: dlopen::Error, path: String) -> String {
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::os::windows::ffi::OsStrExt;
|
use std::os::windows::ffi::OsStrExt;
|
||||||
use winapi::shared::minwindef::DWORD;
|
use winapi::shared::minwindef::DWORD;
|
||||||
use winapi::shared::ntdef::WCHAR;
|
|
||||||
use winapi::shared::winerror::ERROR_INSUFFICIENT_BUFFER;
|
use winapi::shared::winerror::ERROR_INSUFFICIENT_BUFFER;
|
||||||
use winapi::um::errhandlingapi::GetLastError;
|
use winapi::um::errhandlingapi::GetLastError;
|
||||||
use winapi::um::winbase::FormatMessageW;
|
use winapi::um::winbase::FormatMessageW;
|
||||||
|
@ -314,7 +313,7 @@ pub(crate) fn format_error(e: dlopen::Error, path: String) -> String {
|
||||||
let lang_id =
|
let lang_id =
|
||||||
MAKELANGID(LANG_SYSTEM_DEFAULT, SUBLANG_SYS_DEFAULT) as DWORD;
|
MAKELANGID(LANG_SYSTEM_DEFAULT, SUBLANG_SYS_DEFAULT) as DWORD;
|
||||||
|
|
||||||
let mut buf = vec![0 as WCHAR; 500];
|
let mut buf = vec![0; 500];
|
||||||
|
|
||||||
let path = OsStr::new(&path)
|
let path = OsStr::new(&path)
|
||||||
.encode_wide()
|
.encode_wide()
|
||||||
|
|
|
@ -105,8 +105,9 @@
|
||||||
this[_list] = ArrayPrototypeMap(init, (pair, i) => {
|
this[_list] = ArrayPrototypeMap(init, (pair, i) => {
|
||||||
if (pair.length !== 2) {
|
if (pair.length !== 2) {
|
||||||
throw new TypeError(
|
throw new TypeError(
|
||||||
`${prefix}: Item ${i +
|
`${prefix}: Item ${
|
||||||
0} in the parameter list does have length 2 exactly.`,
|
i + 0
|
||||||
|
} in the parameter list does have length 2 exactly.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return [pair[0], pair[1]];
|
return [pair[0], pair[1]];
|
||||||
|
|
|
@ -1499,17 +1499,17 @@
|
||||||
|
|
||||||
if (canceled1 === false) {
|
if (canceled1 === false) {
|
||||||
readableStreamDefaultControllerEnqueue(
|
readableStreamDefaultControllerEnqueue(
|
||||||
/** @type {ReadableStreamDefaultController<any>} */ (branch1[
|
/** @type {ReadableStreamDefaultController<any>} */ branch1[
|
||||||
_controller
|
_controller
|
||||||
]),
|
],
|
||||||
value1,
|
value1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (canceled2 === false) {
|
if (canceled2 === false) {
|
||||||
readableStreamDefaultControllerEnqueue(
|
readableStreamDefaultControllerEnqueue(
|
||||||
/** @type {ReadableStreamDefaultController<any>} */ (branch2[
|
/** @type {ReadableStreamDefaultController<any>} */ branch2[
|
||||||
_controller
|
_controller
|
||||||
]),
|
],
|
||||||
value2,
|
value2,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1519,16 +1519,16 @@
|
||||||
reading = false;
|
reading = false;
|
||||||
if (canceled1 === false) {
|
if (canceled1 === false) {
|
||||||
readableStreamDefaultControllerClose(
|
readableStreamDefaultControllerClose(
|
||||||
/** @type {ReadableStreamDefaultController<any>} */ (branch1[
|
/** @type {ReadableStreamDefaultController<any>} */ branch1[
|
||||||
_controller
|
_controller
|
||||||
]),
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (canceled2 === false) {
|
if (canceled2 === false) {
|
||||||
readableStreamDefaultControllerClose(
|
readableStreamDefaultControllerClose(
|
||||||
/** @type {ReadableStreamDefaultController<any>} */ (branch2[
|
/** @type {ReadableStreamDefaultController<any>} */ branch2[
|
||||||
_controller
|
_controller
|
||||||
]),
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
cancelPromise.resolve(undefined);
|
cancelPromise.resolve(undefined);
|
||||||
|
@ -1586,15 +1586,15 @@
|
||||||
|
|
||||||
uponRejection(reader[_closedPromise].promise, (r) => {
|
uponRejection(reader[_closedPromise].promise, (r) => {
|
||||||
readableStreamDefaultControllerError(
|
readableStreamDefaultControllerError(
|
||||||
/** @type {ReadableStreamDefaultController<any>} */ (branch1[
|
/** @type {ReadableStreamDefaultController<any>} */ branch1[
|
||||||
_controller
|
_controller
|
||||||
]),
|
],
|
||||||
r,
|
r,
|
||||||
);
|
);
|
||||||
readableStreamDefaultControllerError(
|
readableStreamDefaultControllerError(
|
||||||
/** @type {ReadableStreamDefaultController<any>} */ (branch2[
|
/** @type {ReadableStreamDefaultController<any>} */ branch2[
|
||||||
_controller
|
_controller
|
||||||
]),
|
],
|
||||||
r,
|
r,
|
||||||
);
|
);
|
||||||
if (canceled1 === false || canceled2 === false) {
|
if (canceled1 === false || canceled2 === false) {
|
||||||
|
@ -2142,14 +2142,14 @@
|
||||||
const readableController = stream[_readable][_controller];
|
const readableController = stream[_readable][_controller];
|
||||||
if (
|
if (
|
||||||
readableStreamDefaultControllerCanCloseOrEnqueue(
|
readableStreamDefaultControllerCanCloseOrEnqueue(
|
||||||
/** @type {ReadableStreamDefaultController<O>} */ (readableController),
|
/** @type {ReadableStreamDefaultController<O>} */ readableController,
|
||||||
) === false
|
) === false
|
||||||
) {
|
) {
|
||||||
throw new TypeError("Readable stream is unavailable.");
|
throw new TypeError("Readable stream is unavailable.");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
readableStreamDefaultControllerEnqueue(
|
readableStreamDefaultControllerEnqueue(
|
||||||
/** @type {ReadableStreamDefaultController<O>} */ (readableController),
|
/** @type {ReadableStreamDefaultController<O>} */ readableController,
|
||||||
chunk,
|
chunk,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -2157,7 +2157,7 @@
|
||||||
throw stream[_readable][_storedError];
|
throw stream[_readable][_storedError];
|
||||||
}
|
}
|
||||||
const backpressure = readableStreamDefaultcontrollerHasBackpressure(
|
const backpressure = readableStreamDefaultcontrollerHasBackpressure(
|
||||||
/** @type {ReadableStreamDefaultController<O>} */ (readableController),
|
/** @type {ReadableStreamDefaultController<O>} */ readableController,
|
||||||
);
|
);
|
||||||
if (backpressure !== stream[_backpressure]) {
|
if (backpressure !== stream[_backpressure]) {
|
||||||
assert(backpressure === true);
|
assert(backpressure === true);
|
||||||
|
@ -2192,7 +2192,7 @@
|
||||||
const stream = controller[_stream];
|
const stream = controller[_stream];
|
||||||
const readableController = stream[_readable][_controller];
|
const readableController = stream[_readable][_controller];
|
||||||
readableStreamDefaultControllerClose(
|
readableStreamDefaultControllerClose(
|
||||||
/** @type {ReadableStreamDefaultController} */ (readableController),
|
/** @type {ReadableStreamDefaultController} */ readableController,
|
||||||
);
|
);
|
||||||
const error = new TypeError("The stream has been terminated.");
|
const error = new TypeError("The stream has been terminated.");
|
||||||
transformStreamErrorWritableAndUnblockWrite(stream, error);
|
transformStreamErrorWritableAndUnblockWrite(stream, error);
|
||||||
|
@ -2224,7 +2224,7 @@
|
||||||
throw readable[_storedError];
|
throw readable[_storedError];
|
||||||
}
|
}
|
||||||
readableStreamDefaultControllerClose(
|
readableStreamDefaultControllerClose(
|
||||||
/** @type {ReadableStreamDefaultController} */ (readable[_controller]),
|
/** @type {ReadableStreamDefaultController} */ readable[_controller],
|
||||||
);
|
);
|
||||||
}, (r) => {
|
}, (r) => {
|
||||||
transformStreamError(stream, r);
|
transformStreamError(stream, r);
|
||||||
|
@ -2278,9 +2278,9 @@
|
||||||
*/
|
*/
|
||||||
function transformStreamError(stream, e) {
|
function transformStreamError(stream, e) {
|
||||||
readableStreamDefaultControllerError(
|
readableStreamDefaultControllerError(
|
||||||
/** @type {ReadableStreamDefaultController} */ (stream[_readable][
|
/** @type {ReadableStreamDefaultController} */ stream[_readable][
|
||||||
_controller
|
_controller
|
||||||
]),
|
],
|
||||||
e,
|
e,
|
||||||
);
|
);
|
||||||
transformStreamErrorWritableAndUnblockWrite(stream, e);
|
transformStreamErrorWritableAndUnblockWrite(stream, e);
|
||||||
|
@ -3858,7 +3858,7 @@
|
||||||
webidl.assertBranded(this, TransformStreamDefaultController);
|
webidl.assertBranded(this, TransformStreamDefaultController);
|
||||||
const readableController = this[_stream][_readable][_controller];
|
const readableController = this[_stream][_readable][_controller];
|
||||||
return readableStreamDefaultControllerGetDesiredSize(
|
return readableStreamDefaultControllerGetDesiredSize(
|
||||||
/** @type {ReadableStreamDefaultController<O>} */ (readableController),
|
/** @type {ReadableStreamDefaultController<O>} */ readableController,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -849,7 +849,7 @@
|
||||||
descriptor.usage,
|
descriptor.usage,
|
||||||
options,
|
options,
|
||||||
);
|
);
|
||||||
device.trackResource((buffer));
|
device.trackResource(buffer);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,7 +878,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((texture));
|
device.trackResource(texture);
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -905,7 +905,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((sampler));
|
device.trackResource(sampler);
|
||||||
return sampler;
|
return sampler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,7 +948,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((bindGroupLayout));
|
device.trackResource(bindGroupLayout);
|
||||||
return bindGroupLayout;
|
return bindGroupLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -990,7 +990,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((pipelineLayout));
|
device.trackResource(pipelineLayout);
|
||||||
return pipelineLayout;
|
return pipelineLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1083,7 +1083,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((bindGroup));
|
device.trackResource(bindGroup);
|
||||||
return bindGroup;
|
return bindGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1115,7 +1115,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((shaderModule));
|
device.trackResource(shaderModule);
|
||||||
return shaderModule;
|
return shaderModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1172,7 +1172,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((computePipeline));
|
device.trackResource(computePipeline);
|
||||||
return computePipeline;
|
return computePipeline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1247,7 +1247,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((renderPipeline));
|
device.trackResource(renderPipeline);
|
||||||
return renderPipeline;
|
return renderPipeline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1284,7 +1284,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((commandEncoder));
|
device.trackResource(commandEncoder);
|
||||||
return commandEncoder;
|
return commandEncoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1319,7 +1319,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((renderBundleEncoder));
|
device.trackResource(renderBundleEncoder);
|
||||||
return renderBundleEncoder;
|
return renderBundleEncoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1351,7 +1351,7 @@
|
||||||
rid,
|
rid,
|
||||||
descriptor,
|
descriptor,
|
||||||
);
|
);
|
||||||
device.trackResource((querySet));
|
device.trackResource(querySet);
|
||||||
return querySet;
|
return querySet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2436,7 +2436,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((bindGroupLayout));
|
device.trackResource(bindGroupLayout);
|
||||||
return bindGroupLayout;
|
return bindGroupLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2511,7 +2511,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((bindGroupLayout));
|
device.trackResource(bindGroupLayout);
|
||||||
return bindGroupLayout;
|
return bindGroupLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3277,7 +3277,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((commandBuffer));
|
device.trackResource(commandBuffer);
|
||||||
return commandBuffer;
|
return commandBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4606,7 +4606,7 @@
|
||||||
device,
|
device,
|
||||||
rid,
|
rid,
|
||||||
);
|
);
|
||||||
device.trackResource((renderBundle));
|
device.trackResource(renderBundle);
|
||||||
return renderBundle;
|
return renderBundle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,10 +35,11 @@
|
||||||
// ops. Note that "unref" ops are ignored since in nature that are
|
// ops. Note that "unref" ops are ignored since in nature that are
|
||||||
// optional.
|
// optional.
|
||||||
function assertOps(fn) {
|
function assertOps(fn) {
|
||||||
return async function asyncOpSanitizer(...params) {
|
/** @param step {TestStep} */
|
||||||
|
return async function asyncOpSanitizer(step) {
|
||||||
const pre = metrics();
|
const pre = metrics();
|
||||||
try {
|
try {
|
||||||
await fn(...params);
|
await fn(step);
|
||||||
} finally {
|
} finally {
|
||||||
// Defer until next event loop turn - that way timeouts and intervals
|
// Defer until next event loop turn - that way timeouts and intervals
|
||||||
// cleared can actually be removed from resource table, otherwise
|
// cleared can actually be removed from resource table, otherwise
|
||||||
|
@ -46,6 +47,10 @@
|
||||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (step.hasRunningChildren) {
|
||||||
|
return; // test step validation error thrown, don't check ops
|
||||||
|
}
|
||||||
|
|
||||||
const post = metrics();
|
const post = metrics();
|
||||||
|
|
||||||
// We're checking diff because one might spawn HTTP server in the background
|
// We're checking diff because one might spawn HTTP server in the background
|
||||||
|
@ -101,9 +106,15 @@ finishing test case.`;
|
||||||
function assertResources(
|
function assertResources(
|
||||||
fn,
|
fn,
|
||||||
) {
|
) {
|
||||||
return async function resourceSanitizer(...params) {
|
/** @param step {TestStep} */
|
||||||
|
return async function resourceSanitizer(step) {
|
||||||
const pre = core.resources();
|
const pre = core.resources();
|
||||||
await fn(...params);
|
await fn(step);
|
||||||
|
|
||||||
|
if (step.hasRunningChildren) {
|
||||||
|
return; // test step validation error thrown, don't check resources
|
||||||
|
}
|
||||||
|
|
||||||
const post = core.resources();
|
const post = core.resources();
|
||||||
|
|
||||||
const preStr = JSONStringify(pre, null, 2);
|
const preStr = JSONStringify(pre, null, 2);
|
||||||
|
@ -195,11 +206,7 @@ finishing test case.`;
|
||||||
|
|
||||||
function postValidation() {
|
function postValidation() {
|
||||||
// check for any running steps
|
// check for any running steps
|
||||||
const hasRunningSteps = ArrayPrototypeSome(
|
if (step.hasRunningChildren) {
|
||||||
step.children,
|
|
||||||
(r) => r.status === "pending",
|
|
||||||
);
|
|
||||||
if (hasRunningSteps) {
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"There were still test steps running after the current scope finished execution. " +
|
"There were still test steps running after the current scope finished execution. " +
|
||||||
"Ensure all steps are awaited (ex. `await t.step(...)`).",
|
"Ensure all steps are awaited (ex. `await t.step(...)`).",
|
||||||
|
@ -411,7 +418,7 @@ finishing test case.`;
|
||||||
|
|
||||||
const only = ArrayPrototypeFilter(tests, (test) => test.only);
|
const only = ArrayPrototypeFilter(tests, (test) => test.only);
|
||||||
const filtered = ArrayPrototypeFilter(
|
const filtered = ArrayPrototypeFilter(
|
||||||
(only.length > 0 ? only : tests),
|
only.length > 0 ? only : tests,
|
||||||
createTestFilter(filter),
|
createTestFilter(filter),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -485,6 +492,7 @@ finishing test case.`;
|
||||||
#reportedResult = false;
|
#reportedResult = false;
|
||||||
finalized = false;
|
finalized = false;
|
||||||
elapsed = 0;
|
elapsed = 0;
|
||||||
|
/** @type "ok" | "ignored" | "pending" | "failed" */
|
||||||
status = "pending";
|
status = "pending";
|
||||||
error = undefined;
|
error = undefined;
|
||||||
/** @type {TestStep[]} */
|
/** @type {TestStep[]} */
|
||||||
|
@ -521,6 +529,14 @@ finishing test case.`;
|
||||||
this.#params.sanitizeExit;
|
this.#params.sanitizeExit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasRunningChildren() {
|
||||||
|
return ArrayPrototypeSome(
|
||||||
|
this.children,
|
||||||
|
/** @param step {TestStep} */
|
||||||
|
(step) => step.status === "pending",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
failedChildStepsCount() {
|
failedChildStepsCount() {
|
||||||
return ArrayPrototypeFilter(
|
return ArrayPrototypeFilter(
|
||||||
this.children,
|
this.children,
|
||||||
|
|
Loading…
Add table
Reference in a new issue