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

View File

@ -24,7 +24,7 @@ fn new() {
fn get_and_set() {
let map = WeakMap::new();
let key = some_key();
map.set(&key, "value".into());
map.set(&key, &"value".into());
assert_eq!(map.get(&key), "value");
assert_eq!(map.get(&Object::new()), JsValue::undefined());
assert_eq!(map.get(&some_key()), JsValue::undefined());
@ -34,7 +34,7 @@ fn get_and_set() {
fn has() {
let map = WeakMap::new();
let key = some_key();
map.set(&key, "value".into());
map.set(&key, &"value".into());
assert!(map.has(&key));
assert!(!map.has(&Object::new()));
assert!(!map.has(&some_key()));
@ -45,7 +45,7 @@ fn delete() {
let map = WeakMap::new();
let key = some_key();
assert!(!map.has(&key));
map.set(&key, "value".into());
map.set(&key, &"value".into());
assert!(map.has(&key));
map.delete(&key);
assert!(!map.has(&key));