js-sys: Move Intl from a type to a module, since it is a namespace

This commit is contained in:
Nick Fitzgerald 2018-08-10 10:46:53 -07:00
parent a66c4de892
commit 7f5d0a2158

View File

@ -3127,19 +3127,21 @@ extern "C" {
pub fn value_of(this: &Symbol) -> Symbol; pub fn value_of(this: &Symbol) -> Symbol;
} }
// Intl #[allow(non_snake_case)]
#[wasm_bindgen] pub mod Intl {
extern "C" { use super::*;
#[derive(Clone, Debug)]
pub type Intl;
/// The `Intl.getCanonicalLocales()` method returns an array containing // Intl
/// the canonical locale names. Duplicates will be omitted and elements #[wasm_bindgen]
/// will be validated as structurally valid language tags. extern "C" {
/// /// The `Intl.getCanonicalLocales()` method returns an array containing
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales /// the canonical locale names. Duplicates will be omitted and elements
#[wasm_bindgen(static_method_of = Intl, js_name = getCanonicalLocales)] /// will be validated as structurally valid language tags.
pub fn get_canonical_locales(s: &JsValue) -> Array; ///
/// 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 // Promise