From 6608828d7261b7cef95b124179043b6bdcf62767 Mon Sep 17 00:00:00 2001 From: Stephan Wolski Date: Tue, 10 Jul 2018 20:23:09 -0400 Subject: [PATCH] webidl: use JSValue::from in `IntoWasmAbi` for enums --- crates/backend/src/codegen.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/backend/src/codegen.rs b/crates/backend/src/codegen.rs index 06983a165..65f3476fe 100644 --- a/crates/backend/src/codegen.rs +++ b/crates/backend/src/codegen.rs @@ -645,9 +645,7 @@ impl ToTokens for ast::ImportEnum { ::wasm_bindgen::convert::IntoWasmAbi>::Abi; fn into_abi(self, extra: &mut ::wasm_bindgen::convert::Stack) -> Self::Abi { - match self { - #(#variant_paths_ref => ::wasm_bindgen::JsValue::from_str(#variant_strings).into_abi(extra),)* - } + ::wasm_bindgen::JsValue::from(self).into_abi(extra) } }