mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-20 00:11:23 +00:00
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:
committed by
Alex Crichton
parent
93933f033f
commit
61fc8d2567
5
examples/closures/src/lib.rs
Normal file → Executable file
5
examples/closures/src/lib.rs
Normal file → Executable 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()),
|
||||
));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user