mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-11 06:36:05 +00:00
test(js) Don't unwrap to false
.
This commit is contained in:
parent
c450fbf237
commit
d1955c91b7
@ -14,11 +14,14 @@ fn validate() {
|
|||||||
use wasm_bindgen::js::WebAssembly;
|
use wasm_bindgen::js::WebAssembly;
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
pub fn validate_wasm(wasm: JsValue) -> bool {
|
pub fn validate_wasm(wasm: JsValue) -> JsValue {
|
||||||
WebAssembly::validate(wasm).unwrap_or(false)
|
match WebAssembly::validate(wasm) {
|
||||||
|
Ok(value) => value.into(),
|
||||||
|
Err(err) => err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
"#)
|
"#)
|
||||||
.file("test.ts", r#"
|
.file("test.js", r#"
|
||||||
import * as assert from "assert";
|
import * as assert from "assert";
|
||||||
import * as wasm from "./out";
|
import * as wasm from "./out";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user