Skip to content

Commit

Permalink
misc/wasm: avoid implicit boolean to number conversion
Browse files Browse the repository at this point in the history
Fixes golang#36561

Change-Id: I20cbf95ef4fd7c5c255a93ed3ec3e027a0ce2bc2
Reviewed-on: https://go-review.googlesource.com/c/go/+/214944
Reviewed-by: Richard Musiol <[email protected]>
  • Loading branch information
bradfitz committed Feb 25, 2020
1 parent 583419e commit 46f9aea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion misc/wasm/wasm_exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@

// func valueInstanceOf(v ref, t ref) bool
"syscall/js.valueInstanceOf": (sp) => {
this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16));
this.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);
},

// func copyBytesToGo(dst []byte, src ref) (int, bool)
Expand Down

0 comments on commit 46f9aea

Please sign in to comment.