Add extends to js-sys:Intl.PluralRules

This commit is contained in:
Mason Stallmo 2018-08-19 11:03:55 -05:00
parent ee131888da
commit 1762b3cba0
2 changed files with 7 additions and 3 deletions

View File

@ -3546,7 +3546,7 @@ pub mod Intl {
/// that enable plural sensitive formatting and plural language rules.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules
#[wasm_bindgen(js_namespace = Intl)]
#[wasm_bindgen(extends = Object, js_namespace = Intl)]
#[derive(Clone, Debug)]
pub type PluralRules;

View File

@ -87,6 +87,10 @@ fn plural_rules() {
assert!(r.resolved_options().is_instance_of::<Object>());
assert_eq!(r.select(1_f64), "one");
let r = Intl::PluralRules::supported_locales_of(&locales, &opts);
assert!(r.is_instance_of::<Array>());
let a = Intl::PluralRules::supported_locales_of(&locales, &opts);
assert!(a.is_instance_of::<Array>());
assert!(r.is_instance_of::<Intl::PluralRules>());
assert!(r.is_instance_of::<Object>());
let _: &Object = r.as_ref();
}