Browse Source

Bump chrono from 0.4.26 to 0.4.30 (#3263)

* Bump chrono from 0.4.26 to 0.4.30

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.26 to 0.4.30.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.26...v0.4.30)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Replace deprecated methods

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jedel1043 <jedel0124@gmail.com>
pull/3266/head
dependabot[bot] 1 year ago committed by GitHub
parent
commit
306709177b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      Cargo.lock
  2. 2
      boa_engine/Cargo.toml
  3. 25
      boa_engine/src/context/hooks.rs
  4. 2
      boa_wasm/Cargo.toml

6
Cargo.lock generated

@ -715,16 +715,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "chrono" name = "chrono"
version = "0.4.26" version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877"
dependencies = [ dependencies = [
"android-tzdata", "android-tzdata",
"iana-time-zone", "iana-time-zone",
"js-sys", "js-sys",
"num-traits", "num-traits",
"wasm-bindgen", "wasm-bindgen",
"winapi", "windows-targets 0.48.1",
] ]
[[package]] [[package]]

2
boa_engine/Cargo.toml

@ -64,7 +64,7 @@ num-integer = "0.1.45"
bitflags = "2.4.0" bitflags = "2.4.0"
indexmap = "2.0.0" indexmap = "2.0.0"
ryu-js = "0.2.2" ryu-js = "0.2.2"
chrono = { version = "0.4.26", default-features = false, features = ["clock", "std"] } chrono = { version = "0.4.30", default-features = false, features = ["clock", "std"] }
fast-float = "0.2.0" fast-float = "0.2.0"
once_cell = "1.18.0" once_cell = "1.18.0"
tap = "1.0.1" tap = "1.0.1"

25
boa_engine/src/context/hooks.rs

@ -174,7 +174,7 @@ pub trait HostHooks {
/// Gets the current UTC time of the host. /// Gets the current UTC time of the host.
/// ///
/// Defaults to using [`Utc::now`] on all targets, which can cause panics if your platform /// Defaults to using [`Utc::now`] on all targets, which can cause panics if the target
/// doesn't support [`SystemTime::now`][time]. /// doesn't support [`SystemTime::now`][time].
/// ///
/// [time]: std::time::SystemTime::now /// [time]: std::time::SystemTime::now
@ -184,25 +184,36 @@ pub trait HostHooks {
/// Converts the naive datetime `utc` to the corresponding local datetime. /// Converts the naive datetime `utc` to the corresponding local datetime.
/// ///
/// Defaults to using [`Local`] on all targets, which can cause panics if your platform /// Defaults to using [`Local`] on all targets, which can cause panics if the taget
/// doesn't support [`SystemTime::now`][time]. /// doesn't support [`SystemTime::now`][time].
/// ///
/// [time]: std::time::SystemTime::now /// [time]: std::time::SystemTime::now
fn local_from_utc(&self, utc: NaiveDateTime) -> DateTime<FixedOffset> { fn local_from_utc(&self, utc: NaiveDateTime) -> DateTime<FixedOffset> {
let offset = Local.offset_from_utc_datetime(&utc); let offset = Local.offset_from_utc_datetime(&utc);
DateTime::from_utc(utc, offset) offset.from_utc_datetime(&utc)
} }
/// Converts the naive local datetime `local` to a local timezone datetime. /// Converts the naive local datetime `local` to a local timezone datetime.
/// ///
/// Defaults to using [`Local`] on all targets, which can cause panics if your platform /// Defaults to using [`Local`] on all targets, which can cause panics if the target
/// doesn't support [`SystemTime::now`][time]. /// doesn't support [`SystemTime::now`][time].
/// ///
/// [time]: std::time::SystemTime::now /// [time]: std::time::SystemTime::now
fn local_from_naive_local(&self, local: NaiveDateTime) -> LocalResult<DateTime<FixedOffset>> { fn local_from_naive_local(&self, local: NaiveDateTime) -> LocalResult<DateTime<FixedOffset>> {
Local match Local.offset_from_local_datetime(&local) {
.offset_from_local_datetime(&local) LocalResult::None => LocalResult::None,
.map(|offset| DateTime::from_local(local, offset)) LocalResult::Single(offset) => offset.from_local_datetime(&local),
LocalResult::Ambiguous(earliest, latest) => {
match (
earliest.from_local_datetime(&local).earliest(),
latest.from_local_datetime(&local).latest(),
) {
(Some(earliest), Some(latest)) => LocalResult::Ambiguous(earliest, latest),
(Some(dt), None) | (None, Some(dt)) => LocalResult::Single(dt),
(None, None) => LocalResult::None,
}
}
}
} }
} }

2
boa_wasm/Cargo.toml

@ -15,7 +15,7 @@ rust-version.workspace = true
boa_engine.workspace = true boa_engine.workspace = true
wasm-bindgen = "0.2.87" wasm-bindgen = "0.2.87"
getrandom = { version = "0.2.10", features = ["js"] } getrandom = { version = "0.2.10", features = ["js"] }
chrono = { version = "0.4.26", default-features = false, features = ["clock", "std", "wasmbind"] } chrono = { version = "0.4.30", default-features = false, features = ["clock", "std", "wasmbind"] }
console_error_panic_hook = "0.1.7" console_error_panic_hook = "0.1.7"
[features] [features]

Loading…
Cancel
Save