diff --git a/Cargo.lock b/Cargo.lock index 4a2452f..ea6f78b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,6 +117,18 @@ version = "0.9.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b86829876e7e200161a5aa6ea688d46c32d64d70ee3100127790dde84688d6e" +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + [[package]] name = "cap-fs-ext" version = "4.0.2" @@ -126,7 +138,7 @@ dependencies = [ "cap-primitives", "cap-std", "io-lifetimes 3.0.1", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -143,7 +155,7 @@ dependencies = [ "maybe-owned", "rustix", "rustix-linux-procfs", - "windows-sys 0.60.2", + "windows-sys 0.61.2", "winx", ] @@ -266,7 +278,7 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -455,7 +467,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -725,6 +737,17 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "js-sys" +version = "0.3.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + [[package]] name = "json-escape-simd" version = "3.1.1" @@ -948,10 +971,12 @@ checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" [[package]] name = "oxc-browserslist" -version = "3.0.11" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50a403a3c6be65be7bc7730d07d959ec6c143e4ff8117da485df78cd5582260a" +checksum = "456720daa870e4f69f8d29fded1c8deea82da4780a6b8553baa160eb0cd8d864" dependencies = [ + "js-sys", + "libc", "miniz_oxide 0.9.1", "postcard", "rustc-hash", @@ -959,38 +984,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "oxc-miette" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0df30faa68797917ca4263e7a2f889ec829e4da2dcb3d6dc752f7a494180f3" -dependencies = [ - "cfg-if", - "memchr", - "owo-colors", - "oxc-miette-derive", - "textwrap", - "thiserror", - "unicode-segmentation", - "unicode-width", -] - -[[package]] -name = "oxc-miette-derive" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc072d11d45ebe7801459b4e829184ba0934d68027fdc51d327335b53a95a49" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "oxc_allocator" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c603f4ff4617fc04377aa7557396eaa17c77f82e64ffb22947731f75605951f" +checksum = "064fce871c5cb07e557049ed27c8ca2aa530db797f73424c67e4bb8cfe61175e" dependencies = [ "allocator-api2", "hashbrown", @@ -1000,9 +998,9 @@ dependencies = [ [[package]] name = "oxc_ast" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf40d60818cd9ff034774fb371c67d915aa3a6bb0129fdfcb0157a72bda840ff" +checksum = "a999fd4494b604fc0328fc43443bc1298722500587d87d7e993118bd82c65d7b" dependencies = [ "bitflags", "oxc_allocator", @@ -1018,9 +1016,9 @@ dependencies = [ [[package]] name = "oxc_ast_macros" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dd7135befda5e9fab0d549031bf6c0763966bdf596b5429a74c70f0307fcdf5" +checksum = "d715e3c300c95b1d797b05526567161fd86fcac2ac68235101c61b736f216cde" dependencies = [ "phf", "proc-macro2", @@ -1030,9 +1028,9 @@ dependencies = [ [[package]] name = "oxc_ast_visit" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2fe96292c0c8752825d95641696be3252be8ddd32a161257cf03874468884" +checksum = "81b9d77b5c27575ef7d624de1f226caeca3c0d3fcc2347bdaa788d5c4a85512d" dependencies = [ "oxc_allocator", "oxc_ast", @@ -1042,9 +1040,9 @@ dependencies = [ [[package]] name = "oxc_codegen" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a945c0ab712d5c14f5962867d9336753f4ef363a69a85a5a9fc7f1a0dcdc2b5" +checksum = "57b5180ce6f991eacd8c4a85eb28f9fbbff145422dd8ece782f48626957661d0" dependencies = [ "bitflags", "cow-utils", @@ -1063,9 +1061,9 @@ dependencies = [ [[package]] name = "oxc_compat" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887da9e634f5d76da0778674a7303d883e103683fcbc7985cecc9114ce4747ca" +checksum = "bfdfa97a1bb7a8f144937dfb4118ea6e2d681f619c886034f72675b788e1a251" dependencies = [ "cow-utils", "oxc-browserslist", @@ -1186,29 +1184,37 @@ dependencies = [ [[package]] name = "oxc_data_structures" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd2aa418d3599ef5e9880d1a359b27bffff242d4a59e0d62ffe08ebf40acdd99" +checksum = "d15a23b57a931fda6bc9a4fdc3fbabcac6a2edfd0b7216cb7c81432f0e9f54d9" dependencies = [ "ropey", ] [[package]] name = "oxc_diagnostics" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cdd1fcc5edb6d4666ffc82f1647d9784aa15338e671434b8c70211dd44cb66" +checksum = "f2d0ce1ec51b07b6501eecedd5ab50835b7ebe5c8463cada3b2e6d984d0943af" dependencies = [ + "bytecount", "cow-utils", - "oxc-miette", + "itoa", + "memchr", + "owo-colors", + "oxc_span", "percent-encoding", + "smallvec", + "textwrap", + "unicode-segmentation", + "unicode-width", ] [[package]] name = "oxc_ecmascript" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33440685fff66ad5af668cce75130267db8a864938e6433bc264975cd40b2f2c" +checksum = "8b5d3d07165b7aadcd021f62cd95fb7d62cb6977b8bbfb42fa12adbfb7e75257" dependencies = [ "dragonbox_ecma", "itoa", @@ -1222,9 +1228,9 @@ dependencies = [ [[package]] name = "oxc_estree" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2267dd438727a1afe72883eb7bf1533511ee713a5ace72cb59ea439f6bc74dca" +checksum = "fc7af86a59b7aeb2845ffea2cc21ae259053865b175e9ac936a7d72f2744abe5" [[package]] name = "oxc_index" @@ -1238,9 +1244,9 @@ dependencies = [ [[package]] name = "oxc_parser" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f6b2ea4e4b0538aa7925d98af33a68cc246c1a85d5543a9540cde24101c7e2" +checksum = "311c29dfdf55ea8bf065cf300b3d0dca5fe1c0fb8059c9ba70a6c98cce75306e" dependencies = [ "bitflags", "cow-utils", @@ -1262,9 +1268,9 @@ dependencies = [ [[package]] name = "oxc_regular_expression" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde40ebbc9bd3d9a35fa67e518197a2ef92da71c6a0b1496eb7443b5014f3fa9" +checksum = "31839a373ad02a37fad54244a3eb710f9a94b5e2e16ca0e1d28a37b4c75b8ebc" dependencies = [ "bitflags", "oxc_allocator", @@ -1279,9 +1285,9 @@ dependencies = [ [[package]] name = "oxc_semantic" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0c6133ad34ad58b9f00ee277fe044e9f47f1c064dd1cb4cf428fce21a8efe5" +checksum = "366191309f606847936aade62707b06683ed5e0b0c8cb66c27710a61f64a50f1" dependencies = [ "itertools", "memchr", @@ -1315,12 +1321,11 @@ dependencies = [ [[package]] name = "oxc_span" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d7e5d38e008df87a3ec92b2c228b8555e6acd56f7befbaff315d4900c3438bb" +checksum = "c355ae1fa3e865c28cb8a85735ecafd1bb6340a5b880c638d127c1f2d61a98a5" dependencies = [ "compact_str", - "oxc-miette", "oxc_allocator", "oxc_ast_macros", "oxc_estree", @@ -1329,9 +1334,9 @@ dependencies = [ [[package]] name = "oxc_str" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66064b0255f08443382c4b79cf98d0695ad0a40b62644fe3dc232461afd7b941" +checksum = "7ba45ef9efa8296e647aa37b2b21936cb520953031edc1ef6352281bbea22faa" dependencies = [ "compact_str", "hashbrown", @@ -1341,9 +1346,9 @@ dependencies = [ [[package]] name = "oxc_syntax" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb571d2462c910943c527d0230064702513c7354a63b107aa6d953e46a0696c1" +checksum = "0970d9be099a082711b574d58add258549580a70fe6546b99a067bbd7ad4a264" dependencies = [ "bitflags", "cow-utils", @@ -1361,9 +1366,9 @@ dependencies = [ [[package]] name = "oxc_transformer" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1984c305b3a99c5c4d74b9053132e5751b424d97600c0305ce46e8324304100" +checksum = "d286f586303c23502786e31959de18c57bfc66299d1f55b9dc2d56c3f4863f6e" dependencies = [ "base64 0.23.1", "compact_str", @@ -1391,9 +1396,9 @@ dependencies = [ [[package]] name = "oxc_traverse" -version = "0.143.0" +version = "0.146.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006c6a9163ad8299391c8e8696b4db6b8a6bf140d566b1b169e9554d6cb5f1bf" +checksum = "f214c06bfb15427400f7c11fe4487ebeb4d5740b0803ff5f1a1c895198e40a30" dependencies = [ "itoa", "oxc_allocator", @@ -1590,7 +1595,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1863,7 +1868,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1996,13 +2001,58 @@ version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" +[[package]] +name = "wasm-bindgen" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.127" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" +dependencies = [ + "unicode-ident", +] + [[package]] name = "winapi-util" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4c4efc7..dcacc4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,16 +55,16 @@ napi-derive = "3" # Upstream oxc: the parser, AST, semantic and codegen halves of the # instrumenter. Oxc gives no stability guarantee between minors, so all nine # move together on a bump. -oxc_allocator = "0.143" -oxc_ast = "0.143" -oxc_ast_visit = "0.143" -oxc_codegen = "0.143" -oxc_parser = "0.143" -oxc_semantic = "0.143" -oxc_span = "0.143" -oxc_syntax = "0.143" -oxc_transformer = "0.143" -oxc_traverse = "0.143" +oxc_allocator = "0.146" +oxc_ast = "0.146" +oxc_ast_visit = "0.146" +oxc_codegen = "0.146" +oxc_parser = "0.146" +oxc_semantic = "0.146" +oxc_span = "0.146" +oxc_syntax = "0.146" +oxc_transformer = "0.146" +oxc_traverse = "0.146" # Independent source map decoder, used in tests to read back the maps the # instrumenter emits without going through the srcmap crates under test. oxc_sourcemap = "8.0" diff --git a/crates/oxc_coverage_instrument/src/transform/statements.rs b/crates/oxc_coverage_instrument/src/transform/statements.rs index a221f74..0d3b506 100644 --- a/crates/oxc_coverage_instrument/src/transform/statements.rs +++ b/crates/oxc_coverage_instrument/src/transform/statements.rs @@ -266,7 +266,12 @@ pub(super) fn is_container_statement(stmt: &Statement<'_>) -> bool { | Statement::TSTypeAliasDeclaration(_) | Statement::TSInterfaceDeclaration(_) | Statement::TSEnumDeclaration(_) - | Statement::TSModuleDeclaration(_) + // Oxc 0.146 split the old combined `TSModuleDeclaration` into + // `TSExternalModuleDeclaration` (`declare module 'foo' {}`) and + // `TSNamespaceDeclaration` (`namespace Foo {}` / `module Foo {}`). + // Both stay containers, as the single node was. + | Statement::TSExternalModuleDeclaration(_) + | Statement::TSNamespaceDeclaration(_) | Statement::TSImportEqualsDeclaration(_) | Statement::TSExportAssignment(_) | Statement::TSNamespaceExportDeclaration(_)