Add bindings for Intl.getCanonicalLocales

This commit is contained in:
Matias Insaurralde
2018-07-07 08:00:22 -04:00
parent 0e2e826182
commit 8352b4610f
3 changed files with 49 additions and 0 deletions

View File

@ -1628,3 +1628,17 @@ extern "C" {
#[wasm_bindgen(static_method_of = Symbol, getter, structural, js_name = toStringTag)]
pub fn to_string_tag() -> Symbol;
}
// Intl
#[wasm_bindgen]
extern "C" {
pub type Intl;
/// 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;
}