mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-17 06:21:36 +03:00
61fc8d2567
* js-sys: Return `f64` instead of `Number` * js-sys: remove trailing whitespace * js-sys: Ensure that all imported types derive Clone and Debug * js-sys: Imported functions should always take JS object arguments by-ref
14 lines
296 B
Rust
14 lines
296 B
Rust
use wasm_bindgen::JsValue;
|
|
use wasm_bindgen_test::*;
|
|
use js_sys::*;
|
|
|
|
#[wasm_bindgen_test]
|
|
fn new_undefined() {
|
|
assert_eq!(Boolean::new(&JsValue::undefined()).value_of(), false);
|
|
}
|
|
|
|
#[wasm_bindgen_test]
|
|
fn new_truely() {
|
|
assert_eq!(Boolean::new(&JsValue::from("foo")).value_of(), true);
|
|
}
|