Add extends attributes for several types

Part of #670
This commit is contained in:
Andrew Chin
2018-08-08 22:49:06 -04:00
parent 505037ffae
commit cc8095d065
14 changed files with 118 additions and 0 deletions

View File

@ -2,6 +2,7 @@ use std::f64::{INFINITY, NAN};
use wasm_bindgen::JsValue;
use wasm_bindgen_test::*;
use wasm_bindgen::JsCast;
use js_sys::*;
#[wasm_bindgen_test]
@ -104,3 +105,10 @@ fn to_exponential() {
assert_eq!(Number::new(&123456.into()).to_exponential(2).unwrap(), "1.23e+5");
assert!(Number::new(&10.into()).to_exponential(101).is_err());
}
#[wasm_bindgen_test]
fn number_inheritance() {
let n = Number::new(&JsValue::from(42));
assert!(n.is_instance_of::<Number>());
assert!(n.is_instance_of::<Object>());
}