diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 0cf6aab18136..f706df20c6a4 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -367,7 +367,7 @@ impl<'a> Context<'a> { if (type == 'symbol') { const description = val.description; if (description == null) { - return 'Symbol()'; + return 'Symbol'; } else { return 'Symbol(' + description + ')'; } diff --git a/src/lib.rs b/src/lib.rs index ac961fec0868..c853e19a6379 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -529,7 +529,6 @@ impl Clone for JsValue { #[cfg(feature = "std")] impl fmt::Debug for JsValue { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use std::fmt::Write; write!(f, "JsValue({})", self.as_debug_string()) } } diff --git a/tests/wasm/api.rs b/tests/wasm/api.rs index 5a2e11c81584..ce64c000624b 100644 --- a/tests/wasm/api.rs +++ b/tests/wasm/api.rs @@ -71,7 +71,7 @@ pub fn api_get_false() -> JsValue { #[wasm_bindgen] pub fn api_test_bool(a: &JsValue, b: &JsValue, c: &JsValue) { assert_eq!(a.as_bool(), Some(true)); - assert_eq!(format!("{:?}", a), "true"); + assert_eq!(format!("{:?}", a), "JsValue(true)"); assert_eq!(b.as_bool(), Some(false)); assert_eq!(c.as_bool(), None); } @@ -80,7 +80,7 @@ pub fn api_test_bool(a: &JsValue, b: &JsValue, c: &JsValue) { pub fn api_mk_symbol() -> JsValue { let a = JsValue::symbol(None); assert!(a.is_symbol()); - assert_eq!(format!("{:?}", a), "Symbol()"); + assert_eq!(format!("{:?}", a), "JsValue(Symbol)"); return a; } @@ -100,7 +100,7 @@ pub fn api_assert_symbols(a: &JsValue, b: &JsValue) { #[wasm_bindgen] pub fn api_acquire_string(a: &JsValue, b: &JsValue) { assert_eq!(a.as_string().unwrap(), "foo"); - assert_eq!(format!("{:?}", a), "\"foo\""); + assert_eq!(format!("{:?}", a), "JsValue(\"foo\")"); assert_eq!(b.as_string(), None); }