-
-
Notifications
You must be signed in to change notification settings - Fork 670
Closed
Labels
Description
I'm trying to write some code using assert
:
assert(
s.toString() === '{W: 20.0, H: 30.0}',
'toString should be "{W: 20.0, H: 30.0}". Got: "' + s.toString() + '"'
)
and the assert fails with output showing that the strings are equal (despite failing):
toString should be "{W: 20.0, H: 30.0}". Got: "{W: 20.0, H: 30.0}"
As far as I can tell, the strings look identical (I copy and paste them into JS console, and ===
shows true).
But if I try to use ==
, then I get a runtime error:
output from my abort function:
msg: 0 <-- assert() call in rt/pure.ts has no message
file: ~lib/rt/pure.ts
line: 115
col: 13
Error in console:
Uncaught (in promise) RuntimeError: unreachable
at wasm-function[19]:41
at wasm-function[20]:14
at wasm-function[41]:365
at wrap (http://127.0.0.1:8080/js/as-loader.js:250:12)
at runGlas (http://127.0.0.1:8080/ts/index.js:68:9)
How should I compare the strings?