From 780c7236f1de7196f6ab630e05afd6b499b6b087 Mon Sep 17 00:00:00 2001 From: Mason Stallmo Date: Sun, 19 Aug 2018 10:13:25 -0500 Subject: [PATCH] Add extends to js-sys:Intl.DateTimeFormat --- crates/js-sys/src/lib.rs | 2 +- crates/js-sys/tests/wasm/Intl.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index 8b4e2854..89169596 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -3445,7 +3445,7 @@ pub mod Intl { /// that enable language-sensitive date and time formatting. /// /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat - #[wasm_bindgen(js_namespace = Intl)] + #[wasm_bindgen(extends = Object, js_namespace = Intl)] #[derive(Clone, Debug)] pub type DateTimeFormat; diff --git a/crates/js-sys/tests/wasm/Intl.rs b/crates/js-sys/tests/wasm/Intl.rs index a22b75e4..62f6102f 100644 --- a/crates/js-sys/tests/wasm/Intl.rs +++ b/crates/js-sys/tests/wasm/Intl.rs @@ -54,6 +54,10 @@ fn date_time_format() { let a = Intl::DateTimeFormat::supported_locales_of(&locales, &opts); assert!(a.is_instance_of::()); + + assert!(c.is_instance_of::()); + assert!(c.is_instance_of::()); + let _: &Object = c.as_ref(); } #[wasm_bindgen_test]