Js sys once over (#550)

* 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
This commit is contained in:
Nick Fitzgerald
2018-07-25 14:33:44 -07:00
committed by Alex Crichton
parent 93933f033f
commit 61fc8d2567
18 changed files with 216 additions and 184 deletions

5
examples/closures/src/lib.rs Normal file → Executable file
View File

@ -4,7 +4,6 @@ extern crate wasm_bindgen;
extern crate js_sys;
use js_sys::Date;
use js_sys::JsString;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
@ -55,8 +54,8 @@ pub fn run() {
document
.get_element_by_id("current-time")
.set_inner_html(&String::from(
Date::new(JsValue::undefined())
.to_locale_string("en-GB".into(), JsValue::undefined()),
Date::new(&JsValue::undefined())
.to_locale_string(&"en-GB".into(), &JsValue::undefined()),
));
}