webidl: use JSValue::from in IntoWasmAbi for enums

This commit is contained in:
Stephan Wolski 2018-07-10 20:23:09 -04:00
parent c56b1b0189
commit 6608828d72
No known key found for this signature in database
GPG Key ID: FD42CDE01CBEA1D7

View File

@ -645,9 +645,7 @@ impl ToTokens for ast::ImportEnum {
::wasm_bindgen::convert::IntoWasmAbi>::Abi; ::wasm_bindgen::convert::IntoWasmAbi>::Abi;
fn into_abi(self, extra: &mut ::wasm_bindgen::convert::Stack) -> Self::Abi { fn into_abi(self, extra: &mut ::wasm_bindgen::convert::Stack) -> Self::Abi {
match self { ::wasm_bindgen::JsValue::from(self).into_abi(extra)
#(#variant_paths_ref => ::wasm_bindgen::JsValue::from_str(#variant_strings).into_abi(extra),)*
}
} }
} }