Browse Source

fix: crash in node backend when printing numbers

github-actions
Garrit Franke 12 months ago
parent
commit
da22e4f040
  1. 3
      builtin/builtin.js
  2. 2
      examples/playground.sb

3
builtin/builtin.js

@ -1,7 +1,8 @@
/* START builtins */
function _printf(msg) {
process.stdout.write(msg);
// Message is casted to string to prevent crash
process.stdout.write(msg.toString());
}
/* END builtins */

2
examples/playground.sb

@ -1,6 +1,6 @@
fn main() {
let arr = ["Foo", "Bar"]
let arr = [1, 2, 3]
for x in arr {
_printf(x)

Loading…
Cancel
Save