From b10ed2e0819424227980fbb819dcbe6b30b5d4c1 Mon Sep 17 00:00:00 2001 From: Borber Date: Sat, 16 Sep 2023 09:20:23 +0800 Subject: [PATCH] [mod] boa 0.17 -> 0.16 --- Cargo.lock | 463 ++++------------------------------ crates/core/Cargo.toml | 2 +- crates/core/src/live/douyu.rs | 3 - crates/core/src/util.rs | 5 +- 4 files changed, 57 insertions(+), 416 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f310d1f..b69f3ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,17 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", -] - [[package]] name = "aho-corasick" version = "1.0.5" @@ -169,15 +158,6 @@ dependencies = [ "system-deps 6.1.1", ] -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -247,139 +227,71 @@ dependencies = [ "generic-array", ] -[[package]] -name = "boa_ast" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c261398db3b2f9ba05f76872721d6a8a142d10ae6c0a58d3ddc5c2853cc02d" -dependencies = [ - "bitflags 2.4.0", - "boa_interner", - "boa_macros", - "indexmap 2.0.0", - "num-bigint", - "rustc-hash", -] - [[package]] name = "boa_engine" -version = "0.17.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31e7a37b855625f1615a07414fb341361475950e57bb9396afe1389bbc2ccdc" +checksum = "9ad1e1e9d5af81e5051138a3a17dade32a899ebca3bf007678ea245bb8ef3fcd" dependencies = [ - "bitflags 2.4.0", - "boa_ast", + "bitflags 1.3.2", "boa_gc", - "boa_icu_provider", "boa_interner", - "boa_macros", - "boa_parser", "boa_profiler", + "boa_unicode", "chrono", - "dashmap", + "dyn-clone", "fast-float", - "icu_normalizer", - "indexmap 2.0.0", - "itertools", + "gc", + "indexmap 1.9.3", "num-bigint", "num-integer", "num-traits", - "num_enum 0.6.1", "once_cell", - "pollster", "rand 0.8.5", "regress", "rustc-hash", "ryu-js", "serde", "serde_json", - "sptr", - "static_assertions", "tap", - "thin-vec", - "thiserror", + "unicode-normalization", ] [[package]] name = "boa_gc" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2346f8ac7b736236de0608a7c75a9a32bac0a1137b98574cfebde6343e4ff6b7" -dependencies = [ - "boa_macros", - "boa_profiler", - "thin-vec", -] - -[[package]] -name = "boa_icu_provider" -version = "0.17.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07652c6f1ca97bbe16bd2ab1ebc39313ac81568d2671aeb24a4a45964d2291a4" +checksum = "ca7b8b2de06b105e2515b4ec1906dfd9ce882d8337e8e10484ced8ba9d8cb83f" dependencies = [ - "icu_collections", - "icu_normalizer", - "icu_properties", - "icu_provider", - "once_cell", - "zerovec", + "gc", ] [[package]] name = "boa_interner" -version = "0.17.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b968bd467737cace9723a5d01a3d32fe95471526d36db9654a1779c4b766fb6" +checksum = "45609e07dcbc9315bbd10e2a6499da4469b2caddc1374bcc823ac5720d8b9dc5" dependencies = [ - "boa_gc", - "boa_macros", - "hashbrown 0.14.0", - "indexmap 2.0.0", - "once_cell", "phf 0.11.2", "rustc-hash", "static_assertions", ] [[package]] -name = "boa_macros" -version = "0.17.0" +name = "boa_profiler" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3de43b7806061fccfba716fef51eea462d636de36803b62d10f902608ffef4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", - "synstructure 0.13.0", -] +checksum = "16acab52167770e9e6dc5c5fd3029750830ecaf1e8012575816a214846d22b7c" [[package]] -name = "boa_parser" -version = "0.17.0" +name = "boa_unicode" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff1108bda6d573049191b6452490844c5ba4b12f7bdcc512a33e5c3f5037196" +checksum = "53e4c2363034392bf23f3d2ad8b3ba50ec7de4126374b329370b6902c72487ca" dependencies = [ - "bitflags 2.4.0", - "boa_ast", - "boa_icu_provider", - "boa_interner", - "boa_macros", - "boa_profiler", - "fast-float", - "icu_properties", - "num-bigint", - "num-traits", - "once_cell", - "regress", - "rustc-hash", + "unicode-general-category", ] -[[package]] -name = "boa_profiler" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a24f6aa1ecc56e797506437b1f9a172e4a5f207894e74196c682cb656d2c2d60" - [[package]] name = "brotli" version = "3.3.4" @@ -703,12 +615,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "critical-section" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" - [[package]] name = "crossbeam-channel" version = "0.5.8" @@ -810,19 +716,6 @@ dependencies = [ "syn 2.0.33", ] -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.0", - "lock_api", - "once_cell", - "parking_lot_core", -] - [[package]] name = "data-encoding" version = "2.4.0" @@ -888,17 +781,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", -] - [[package]] name = "dtoa" version = "1.0.9" @@ -921,10 +803,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] -name = "either" -version = "1.9.0" +name = "dyn-clone" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "embed-resource" @@ -1153,6 +1035,27 @@ dependencies = [ "byteorder", ] +[[package]] +name = "gc" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3edaac0f5832202ebc99520cb77c932248010c4645d20be1dc62d6579f5b3752" +dependencies = [ + "gc_derive", +] + +[[package]] +name = "gc_derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60df8444f094ff7885631d80e78eb7d88c3c2361a98daaabb06256e4500db941" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "gdk" version = "0.15.4" @@ -1475,15 +1378,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.14.0" @@ -1641,88 +1535,6 @@ dependencies = [ "png", ] -[[package]] -name = "icu_collections" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8302d8dfd6044d3ddb3f807a5ef3d7bbca9a574959c6d6e4dc39aa7012d0d5" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3003f85dccfc0e238ff567693248c59153a46f4e6125ba4020b973cef4d1d335" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", -] - -[[package]] -name = "icu_normalizer" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "652869735c9fb9f5a64ba180ee16f2c848390469c116deef517ecc53f4343598" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_properties" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0e1aa26851f16c9e04412a5911c86b7f8768dac8f8d4c5f1c568a7e5d7a434" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_provider" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dc312a7b6148f7dfe098047ae2494d12d4034f48ade58d4f353000db376e305" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "serde", - "stable_deref_trait", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b728b9421e93eff1d9f8681101b78fa745e0748c95c655c83f337044a7e10" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -1826,15 +1638,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "0.4.8" @@ -1950,12 +1753,6 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" -[[package]] -name = "litemap" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a04a5b2b6f54acba899926491d0a6c59d98012938ca2ab5befb281c034e8f94" - [[package]] name = "lock_api" version = "0.4.10" @@ -2109,7 +1906,7 @@ dependencies = [ "bitflags 1.3.2", "jni-sys", "ndk-sys", - "num_enum 0.5.11", + "num_enum", "thiserror", ] @@ -2208,16 +2005,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive 0.5.11", -] - -[[package]] -name = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive 0.6.1", + "num_enum_derive", ] [[package]] @@ -2232,18 +2020,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "num_enum_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.33", -] - [[package]] name = "objc" version = "0.2.7" @@ -2286,10 +2062,6 @@ name = "once_cell" version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" -dependencies = [ - "atomic-polyfill", - "critical-section", -] [[package]] name = "open" @@ -2612,12 +2384,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "pollster" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2859,11 +2625,10 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "regress" -version = "0.6.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9ecfa0cb04d0b04dddb99b8ccf4f66bc8dfd23df694b398570bd8ae3a50fb" +checksum = "0a92ff21fe8026ce3f2627faaf43606f0b67b014dbc9ccf027181a804f75d92e" dependencies = [ - "hashbrown 0.13.2", "memchr", ] @@ -3384,12 +3149,6 @@ dependencies = [ "system-deps 5.0.0", ] -[[package]] -name = "sptr" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -3477,18 +3236,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "synstructure" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "285ba80e733fac80aa4270fbcdf83772a79b80aa35c97075320abfee4a915b06" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.33", - "unicode-xid", -] - [[package]] name = "system-deps" version = "5.0.0" @@ -3810,12 +3557,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" -[[package]] -name = "thin-vec" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac81b6fd6beb5884b0cf3321b8117e6e5d47ecb6fc89f414cfdcca8b2fe2dd8" - [[package]] name = "thiserror" version = "1.0.48" @@ -3874,16 +3615,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tinystr" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -4125,6 +3856,12 @@ version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +[[package]] +name = "unicode-general-category" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -4176,18 +3913,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52df8b7fb78e7910d776fccf2e42ceaf3604d55e8e7eb2dbd183cb1441d8a692" - -[[package]] -name = "utf8_iter" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a8922555b9500e3d865caed19330172cd67cbf82203f1a3311d8c305cc9f33" - [[package]] name = "utf8parse" version = "0.2.1" @@ -4725,18 +4450,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60e49e42bdb1d5dc76f4cd78102f8f0714d32edfa3efb82286eb0f0b1fc0da0f" - [[package]] name = "wry" version = "0.24.4" @@ -4804,71 +4517,3 @@ checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" dependencies = [ "libc", ] - -[[package]] -name = "yoke" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1848075a23a28f9773498ee9a0f2cf58fcbad4f8c0ccf84a210ab33c6ae495de" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af46c169923ed7516eef0aa32b56d2651b229f57458ebe46b49ddd6efef5b7a2" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure 0.12.6", -] - -[[package]] -name = "zerofrom" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d76c3251de27615dfcce21e636c172dafb2549cd7fd93e21c66f6ca6bea2" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eae7c1f7d4b8eafce526bc0771449ddc2f250881ae31c50d22c032b5a1c499" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure 0.12.6", -] - -[[package]] -name = "zerovec" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "198f54134cd865f437820aa3b43d0ad518af4e68ee161b444cdd15d8e567c8ea" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486558732d5dde10d0f8cb2936507c1bb21bc539d924c949baf5f36a58e51bac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure 0.12.6", -] diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 7618145..6616265 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -26,7 +26,7 @@ base64 = "0.21" reqwest = { version = "0.11", features = ["json", "gzip", "deflate"] } -boa_engine = "0.17" +boa_engine = "0.16" [target.'cfg(unix)'.dependencies] diff --git a/crates/core/src/live/douyu.rs b/crates/core/src/live/douyu.rs index 37a4e05..e903f70 100644 --- a/crates/core/src/live/douyu.rs +++ b/crates/core/src/live/douyu.rs @@ -91,11 +91,8 @@ impl Live for Client { format!("\"{}\";", &rb).as_str(), ); - println!("res: {}", res); - // 运行js获取签名值 let sign = eval(&res); - println!("sign: {}", sign); let sign = sign.trim_matches('"'); let sign = sign.rsplit_once('=').ok_or(SeamError::NeedFix("sign"))?.1; diff --git a/crates/core/src/util.rs b/crates/core/src/util.rs index 8d1a7e2..b52569c 100644 --- a/crates/core/src/util.rs +++ b/crates/core/src/util.rs @@ -1,5 +1,4 @@ use boa_engine::Context; -use boa_engine::Source; use reqwest::header::HeaderMap; use reqwest::header::HeaderName; use reqwest::header::HeaderValue; @@ -12,9 +11,9 @@ use std::str::FromStr; /// js运行时 pub fn eval(js: &str) -> String { let mut context = Context::default(); - match context.eval(Source::from_bytes(js)) { + match context.eval(js) { Ok(result) => result.display().to_string(), - Err(e) => e.to_string(), + Err(e) => e.display().to_string(), } }