From 2458d736690d114cc73dd6d020501a728c02aa1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Juli=C3=A1n=20Espina?= Date: Tue, 25 Jun 2024 19:21:36 +0000 Subject: [PATCH] Bump temporal_rs to latest commit (#3880) * Bump temporal_rs to latest commit * Fix build * update test262 * bump temporal pt. 2 * bump temporal pt. 3 * bump temporal (last time) --- Cargo.lock | 257 +++++++++--------- Cargo.toml | 2 +- core/engine/src/builtins/options.rs | 2 +- .../src/builtins/temporal/duration/mod.rs | 7 +- core/engine/src/builtins/temporal/error.rs | 1 + .../src/builtins/temporal/instant/mod.rs | 8 +- core/engine/src/builtins/temporal/options.rs | 50 +--- .../src/builtins/temporal/time_zone/mod.rs | 64 ----- test262_config.toml | 2 +- 9 files changed, 150 insertions(+), 243 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 375a4d937c2..df825ab7405 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -132,7 +132,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite", ] @@ -163,9 +163,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ "async-lock", "cfg-if", @@ -173,7 +173,7 @@ dependencies = [ "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.0", + "polling 3.7.2", "rustix", "slab", "tracing", @@ -182,12 +182,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.3.1", + "event-listener-strategy", "pin-project-lite", ] @@ -204,9 +204,9 @@ dependencies = [ [[package]] name = "async-process" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53fc6301894e04a92cb2584fedde80cb25ba8e02d9dc39d4a87d036e22f397d" +checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" dependencies = [ "async-channel 2.3.1", "async-io", @@ -215,7 +215,7 @@ dependencies = [ "async-task", "blocking", "cfg-if", - "event-listener 5.3.0", + "event-listener 5.3.1", "futures-lite 2.3.0", "rustix", "tracing", @@ -224,9 +224,9 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" dependencies = [ "async-io", "async-lock", @@ -287,9 +287,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -312,12 +312,12 @@ name = "boa_ast" version = "0.18.0" dependencies = [ "arbitrary", - "bitflags 2.5.0", + "bitflags 2.6.0", "boa_interner", "boa_macros", "indexmap", "num-bigint", - "rustc-hash", + "rustc-hash 1.1.0", "serde", ] @@ -345,7 +345,7 @@ name = "boa_engine" version = "0.18.0" dependencies = [ "arrayvec", - "bitflags 2.5.0", + "bitflags 2.6.0", "boa_ast", "boa_gc", "boa_icu_provider", @@ -390,7 +390,7 @@ dependencies = [ "portable-atomic", "rand", "regress", - "rustc-hash", + "rustc-hash 1.1.0", "ryu-js", "serde", "serde_json", @@ -460,7 +460,7 @@ dependencies = [ "indexmap", "once_cell", "phf", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "static_assertions", ] @@ -472,7 +472,7 @@ dependencies = [ "boa_engine", "boa_gc", "boa_macros", - "rustc-hash", + "rustc-hash 1.1.0", ] [[package]] @@ -497,7 +497,7 @@ dependencies = [ name = "boa_parser" version = "0.18.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "boa_ast", "boa_interner", "boa_macros", @@ -507,7 +507,7 @@ dependencies = [ "num-bigint", "num-traits", "regress", - "rustc-hash", + "rustc-hash 1.1.0", ] [[package]] @@ -516,7 +516,7 @@ version = "0.18.0" dependencies = [ "measureme", "once_cell", - "rustc-hash", + "rustc-hash 1.1.0", ] [[package]] @@ -526,7 +526,7 @@ dependencies = [ "boa_engine", "boa_gc", "indoc", - "rustc-hash", + "rustc-hash 1.1.0", "textwrap", ] @@ -537,7 +537,7 @@ dependencies = [ "boa_macros", "fast-float", "paste", - "rustc-hash", + "rustc-hash 1.1.0", "sptr", "static_assertions", ] @@ -546,7 +546,7 @@ dependencies = [ name = "boa_tester" version = "0.18.0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "boa_engine", "boa_gc", "boa_runtime", @@ -557,7 +557,7 @@ dependencies = [ "comfy-table", "phf", "rayon", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "serde_repr", @@ -682,9 +682,9 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" [[package]] name = "cc" -version = "1.0.98" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" [[package]] name = "cfg-if" @@ -753,7 +753,7 @@ version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -761,9 +761,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "clipboard-win" @@ -954,7 +954,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "crossterm_winapi", "libc", "parking_lot", @@ -1082,7 +1082,7 @@ dependencies = [ "lazy_static", "mintex", "parking_lot", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "thousands", @@ -1090,9 +1090,9 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", @@ -1174,43 +1174,22 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.0", + "event-listener 5.3.1", "pin-project-lite", ] @@ -1437,12 +1416,6 @@ dependencies = [ "allocator-api2", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -1455,6 +1428,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "http" version = "0.2.12" @@ -1492,9 +1471,9 @@ dependencies = [ [[package]] name = "icu_calendar" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7defdcb785245edd773a38b56f0ccef39065cdc4509a7d85435f6edea0fd58c5" +checksum = "7265b2137f9a36f7634a308d91f984574bbdba8cfd95ceffe1c345552275a8ff" dependencies = [ "calendrical_calculations", "databake", @@ -1517,9 +1496,9 @@ checksum = "8e009b7f0151ee6fb28c40b1283594397e0b7183820793e9ace3dcd13db126d0" [[package]] name = "icu_casemap" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7701c9ff229dae365623cfb1b24c86552fe3a8e82877f9a75400b95452a9c02" +checksum = "9ff0c8ae9f8d31b12e27fc385ff9ab1f3cd9b17417c665c49e4ec958c37da75f" dependencies = [ "databake", "displaydoc", @@ -1810,9 +1789,9 @@ dependencies = [ [[package]] name = "icu_properties" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ "databake", "displaydoc", @@ -1988,7 +1967,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.52.0", ] @@ -2050,6 +2029,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "ixdtf" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2123305f927452a9502fc05c33800280d90127c95c50eb45ec6b3c50346afbf3" +dependencies = [ + "displaydoc", +] + [[package]] name = "jemalloc-sys" version = "0.5.4+5.3.0-patched" @@ -2081,9 +2069,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" @@ -2170,15 +2158,15 @@ dependencies = [ "memmap2", "parking_lot", "perf-event-open-sys", - "rustc-hash", + "rustc-hash 1.1.0", "smallvec", ] [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -2206,9 +2194,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -2238,7 +2226,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "cfg_aliases", "libc", @@ -2306,7 +2294,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -2515,9 +2503,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -2576,13 +2564,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi", + "hermit-abi 0.4.0", "pin-project-lite", "rustix", "tracing", @@ -2709,11 +2697,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -2724,8 +2712,8 @@ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -2740,13 +2728,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -2757,9 +2745,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "regress" @@ -2798,13 +2786,19 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustix" version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -2854,7 +2848,7 @@ version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7803e8936da37efd9b6d4478277f4b2b9bb5cdb37a113e8d63222e58da647e63" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "clipboard-win", "fd-lock", @@ -2972,9 +2966,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", @@ -3144,17 +3138,17 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", @@ -3163,9 +3157,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -3207,13 +3201,14 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "temporal_rs" version = "0.0.2" -source = "git+https://github.com/boa-dev/temporal.git?rev=61a05fbb7c72353deda72a3df0e6887d65b840d2#61a05fbb7c72353deda72a3df0e6887d65b840d2" +source = "git+https://github.com/boa-dev/temporal.git?rev=ec2f2d00294ee641285ec1570df6683ecd0d1a8e#ec2f2d00294ee641285ec1570df6683ecd0d1a8e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "icu_calendar", + "ixdtf", "num-bigint", "num-traits", - "rustc-hash", + "rustc-hash 2.0.0", "tinystr", ] @@ -3370,9 +3365,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] @@ -3434,7 +3429,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.9", + "winnow 0.6.13", ] [[package]] @@ -3561,9 +3556,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unsafe-libyaml" @@ -3596,9 +3591,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -3619,9 +3614,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" @@ -3816,9 +3811,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -4004,9 +3999,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.9" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -4114,9 +4109,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +checksum = "5d7fce6acea41ceb5b97f7aee91a5d876d5fbca1f847cb60e13afecd7093cad0" dependencies = [ "databake", "serde", @@ -4127,9 +4122,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index f061ff91c86..9602ca3e89c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -115,7 +115,7 @@ intrusive-collections = "0.9.6" cfg-if = "1.0.0" either = "1.12.0" sys-locale = "0.3.1" -temporal_rs = { git = "https://github.com/boa-dev/temporal.git", rev = "61a05fbb7c72353deda72a3df0e6887d65b840d2" } +temporal_rs = { git = "https://github.com/boa-dev/temporal.git", rev = "ec2f2d00294ee641285ec1570df6683ecd0d1a8e" } web-time = "1.1.0" criterion = "0.5.1" float-cmp = "0.9.0" diff --git a/core/engine/src/builtins/options.rs b/core/engine/src/builtins/options.rs index 368566e0686..4c939c91649 100644 --- a/core/engine/src/builtins/options.rs +++ b/core/engine/src/builtins/options.rs @@ -116,7 +116,7 @@ impl OptionType for f64 { if !value.is_finite() { return Err(JsNativeError::range() - .with_message("roundingIncrement must be finite.") + .with_message("numeric option must be finite.") .into()); } diff --git a/core/engine/src/builtins/temporal/duration/mod.rs b/core/engine/src/builtins/temporal/duration/mod.rs index f22ef7599c1..7c1c91adcd2 100644 --- a/core/engine/src/builtins/temporal/duration/mod.rs +++ b/core/engine/src/builtins/temporal/duration/mod.rs @@ -18,11 +18,11 @@ use boa_macros::js_str; use boa_profiler::Profiler; use temporal_rs::{ components::Duration as InnerDuration, - options::{RelativeTo, TemporalRoundingMode, TemporalUnit}, + options::{RelativeTo, RoundingIncrement, TemporalRoundingMode, TemporalUnit}, }; use super::{ - options::{get_temporal_rounding_increment, get_temporal_unit, TemporalUnitGroup}, + options::{get_temporal_unit, TemporalUnitGroup}, to_integer_if_integral, DateTimeValues, }; @@ -658,7 +658,8 @@ impl Duration { super::to_relative_temporal_object(&round_to, context)?; // 13. Let roundingIncrement be ? ToTemporalRoundingIncrement(roundTo). - let rounding_increment = get_temporal_rounding_increment(&round_to, context)?; + let rounding_increment = + get_option::(&round_to, js_str!("roundingIncrement"), context)?; // 14. Let roundingMode be ? ToTemporalRoundingMode(roundTo, "halfExpand"). let rounding_mode = diff --git a/core/engine/src/builtins/temporal/error.rs b/core/engine/src/builtins/temporal/error.rs index 22757acdf9b..5755434b4ef 100644 --- a/core/engine/src/builtins/temporal/error.rs +++ b/core/engine/src/builtins/temporal/error.rs @@ -9,6 +9,7 @@ impl From for JsNativeError { ErrorKind::Type => JsNativeError::typ().with_message(value.message()), ErrorKind::Generic => JsNativeError::error().with_message(value.message()), ErrorKind::Syntax => JsNativeError::syntax().with_message(value.message()), + ErrorKind::Assert => JsNativeError::error().with_message("internal engine error"), } } } diff --git a/core/engine/src/builtins/temporal/instant/mod.rs b/core/engine/src/builtins/temporal/instant/mod.rs index d4c927e4ca4..3c02f38be55 100644 --- a/core/engine/src/builtins/temporal/instant/mod.rs +++ b/core/engine/src/builtins/temporal/instant/mod.rs @@ -23,7 +23,7 @@ use boa_macros::js_str; use boa_profiler::Profiler; use temporal_rs::{ components::Instant as InnerInstant, - options::{TemporalRoundingMode, TemporalUnit}, + options::{RoundingIncrement, TemporalRoundingMode, TemporalUnit}, }; /// The `Temporal.Instant` object. @@ -287,7 +287,8 @@ impl Instant { // Fetch the necessary options. let options = get_options_object(args.get_or_undefined(1))?; let mode = get_option::(&options, js_str!("roundingMode"), context)?; - let increment = get_option::(&options, js_str!("roundingIncrement"), context)?; + let increment = + get_option::(&options, js_str!("roundingIncrement"), context)?; let smallest_unit = get_option::(&options, js_str!("smallestUnit"), context)?; let largest_unit = get_option::(&options, js_str!("largestUnit"), context)?; let result = instant @@ -315,7 +316,8 @@ impl Instant { let other = to_temporal_instant(args.get_or_undefined(0))?; let options = get_options_object(args.get_or_undefined(1))?; let mode = get_option::(&options, js_str!("roundingMode"), context)?; - let increment = get_option::(&options, js_str!("roundingIncrement"), context)?; + let increment = + get_option::(&options, js_str!("roundingIncrement"), context)?; let smallest_unit = get_option::(&options, js_str!("smallestUnit"), context)?; let largest_unit = get_option::(&options, js_str!("largestUnit"), context)?; let result = instant diff --git a/core/engine/src/builtins/temporal/options.rs b/core/engine/src/builtins/temporal/options.rs index a13fe2865de..146c875ccd9 100644 --- a/core/engine/src/builtins/temporal/options.rs +++ b/core/engine/src/builtins/temporal/options.rs @@ -9,53 +9,17 @@ // https://github.com/tc39/proposal-temporal/blob/main/polyfill/index.d.ts use crate::{ - builtins::options::{get_option, ParsableOptionType}, - js_string, + builtins::options::{get_option, OptionType, ParsableOptionType}, string::JsStr, - Context, JsNativeError, JsObject, JsResult, + Context, JsNativeError, JsObject, JsResult, JsValue, }; use temporal_rs::options::{ ArithmeticOverflow, DurationOverflow, InstantDisambiguation, OffsetDisambiguation, - TemporalRoundingMode, TemporalUnit, + RoundingIncrement, TemporalRoundingMode, TemporalUnit, }; // TODO: Expand docs on the below options. -// TODO: Remove and refactor: migrate to `boa_temporal` -#[inline] -pub(crate) fn get_temporal_rounding_increment( - options: &JsObject, - context: &mut Context, -) -> JsResult> { - // 1. Let increment be ? GetOption(normalizedOptions, "roundingIncrement", "number", undefined, 1𝔽). - let value = options.get(js_string!("roundingIncrement"), context)?; - - if value.is_undefined() { - return Ok(None); - } - let increment = value.to_number(context)?; - - // 2. If increment is not finite, throw a RangeError exception. - if !increment.is_finite() { - return Err(JsNativeError::range() - .with_message("rounding increment was out of range.") - .into()); - } - - // 3. Let integerIncrement be truncate(ℝ(increment)). - let integer_increment = increment.trunc(); - - // 4. If integerIncrement < 1 or integerIncrement > 10^9, throw a RangeError exception. - if !(1.0..=1_000_000_000.0).contains(&integer_increment) { - return Err(JsNativeError::range() - .with_message("rounding increment was out of range.") - .into()); - } - - // 5. Return integerIncrement. - Ok(Some(integer_increment)) -} - /// Gets the `TemporalUnit` from an options object. #[inline] pub(crate) fn get_temporal_unit( @@ -135,3 +99,11 @@ impl ParsableOptionType for DurationOverflow {} impl ParsableOptionType for InstantDisambiguation {} impl ParsableOptionType for OffsetDisambiguation {} impl ParsableOptionType for TemporalRoundingMode {} + +impl OptionType for RoundingIncrement { + fn from_value(value: JsValue, context: &mut Context) -> JsResult { + let value = value.to_number(context)?; + + Ok(RoundingIncrement::try_from(value)?) + } +} diff --git a/core/engine/src/builtins/temporal/time_zone/mod.rs b/core/engine/src/builtins/temporal/time_zone/mod.rs index a1e35e93e6a..652d76d5240 100644 --- a/core/engine/src/builtins/temporal/time_zone/mod.rs +++ b/core/engine/src/builtins/temporal/time_zone/mod.rs @@ -336,70 +336,6 @@ pub(super) fn create_temporal_time_zone( .into()) } -/// Abstract operation `ParseTimeZoneOffsetString ( offsetString )` -/// -/// The abstract operation `ParseTimeZoneOffsetString` takes argument `offsetString` (a String). It -/// parses the argument as a numeric UTC offset string and returns a signed integer representing -/// that offset as a number of nanoseconds. -/// -/// More information: -/// - [ECMAScript specififcation][spec] -/// -/// [spec]: https://tc39.es/ecma262/#sec-parsetimezoneoffsetstring -#[allow(clippy::unnecessary_wraps, unused)] -fn parse_timezone_offset_string(offset_string: &str, context: &mut Context) -> JsResult { - use temporal_rs::parser::{Cursor, TemporalTimeZoneString}; - - // 1. Let parseResult be ParseText(StringToCodePoints(offsetString), UTCOffset). - let parse_result = TemporalTimeZoneString::parse(&mut Cursor::new(offset_string))?; - - // 2. Assert: parseResult is not a List of errors. - // 3. Assert: parseResult contains a TemporalSign Parse Node. - let Some(utc_offset) = parse_result.offset else { - return Err(JsNativeError::typ() - .with_message("Offset string was not a valid offset") - .into()); - }; - - // 4. Let parsedSign be the source text matched by the TemporalSign Parse Node contained within - // parseResult. - // 5. If parsedSign is the single code point U+002D (HYPHEN-MINUS) or U+2212 (MINUS SIGN), then - let sign = utc_offset.sign; - // a. Let sign be -1. - // 6. Else, - // a. Let sign be 1. - - // 7. NOTE: Applications of StringToNumber below do not lose precision, since each of the parsed - // values is guaranteed to be a sufficiently short string of decimal digits. - // 8. Assert: parseResult contains an Hour Parse Node. - // 9. Let parsedHours be the source text matched by the Hour Parse Node contained within parseResult. - let parsed_hours = utc_offset.hour; - - // 10. Let hours be ℝ(StringToNumber(CodePointsToString(parsedHours))). - // 11. If parseResult does not contain a MinuteSecond Parse Node, then - // a. Let minutes be 0. - // 12. Else, - // a. Let parsedMinutes be the source text matched by the first MinuteSecond Parse Node contained within parseResult. - // b. Let minutes be ℝ(StringToNumber(CodePointsToString(parsedMinutes))). - // 13. If parseResult does not contain two MinuteSecond Parse Nodes, then - // a. Let seconds be 0. - // 14. Else, - // a. Let parsedSeconds be the source text matched by the second MinuteSecond Parse Node contained within parseResult. - // b. Let seconds be ℝ(StringToNumber(CodePointsToString(parsedSeconds))). - // 15. If parseResult does not contain a TemporalDecimalFraction Parse Node, then - // a. Let nanoseconds be 0. - // 16. Else, - // a. Let parsedFraction be the source text matched by the TemporalDecimalFraction Parse Node contained within parseResult. - // b. Let fraction be the string-concatenation of CodePointsToString(parsedFraction) and "000000000". - // c. Let nanosecondsString be the substring of fraction from 1 to 10. - // d. Let nanoseconds be ℝ(StringToNumber(nanosecondsString)). - // 17. Return sign × (((hours × 60 + minutes) × 60 + seconds) × 10^9 + nanoseconds). - - Err(JsNativeError::error() - .with_message("not yet implemented.") - .into()) -} - /// Abstract operation `FormatTimeZoneOffsetString ( offsetNanoseconds )` fn format_time_zone_offset_string(offset_nanoseconds: i64) -> String { // 1. Assert: offsetNanoseconds is an integer. diff --git a/test262_config.toml b/test262_config.toml index ba75e1590d6..d5a1842e242 100644 --- a/test262_config.toml +++ b/test262_config.toml @@ -1,4 +1,4 @@ -commit = "c00830acef42bdb0e917b5fdec76ed9d399c0eea" +commit = "c47b716e8d6bea0c4510d449fd22b7ed5f8b0151" [ignored] # Not implemented yet: