From 7f5d0a215810949665db8bdee2398f9507a83e91 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Fri, 10 Aug 2018 10:46:53 -0700 Subject: [PATCH] js-sys: Move `Intl` from a type to a module, since it is a namespace --- crates/js-sys/src/lib.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index bda4a73a..1c4639d8 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -3127,19 +3127,21 @@ extern "C" { pub fn value_of(this: &Symbol) -> Symbol; } -// Intl -#[wasm_bindgen] -extern "C" { - #[derive(Clone, Debug)] - pub type Intl; +#[allow(non_snake_case)] +pub mod Intl { + use super::*; - /// The `Intl.getCanonicalLocales()` method returns an array containing - /// the canonical locale names. Duplicates will be omitted and elements - /// will be validated as structurally valid language tags. - /// - /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales - #[wasm_bindgen(static_method_of = Intl, js_name = getCanonicalLocales)] - pub fn get_canonical_locales(s: &JsValue) -> Array; + // Intl + #[wasm_bindgen] + extern "C" { + /// The `Intl.getCanonicalLocales()` method returns an array containing + /// the canonical locale names. Duplicates will be omitted and elements + /// will be validated as structurally valid language tags. + /// + /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales + #[wasm_bindgen(js_name = getCanonicalLocales, js_namespace = Intl)] + pub fn get_canonical_locales(s: &JsValue) -> Array; + } } // Promise