Skip to content

Commit

Permalink
fix(example): update grammar for wasm backend
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-jerry-ye committed Dec 3, 2024
1 parent e622c92 commit 5d8ee28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions legacy/examples/snake/extern/string.wasm.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn JsArray::new() -> JsArray = "array" "new"

fn push(self : JsArray, charCode : Int) = "array" "push"

pub type JsString
pub(all) type JsString

fn JsString::from_char_code(charCode : JsArray) -> JsString = "string" "fromCharCode"

Expand All @@ -38,7 +38,7 @@ pub fn JsString::from_string(str : String) -> JsString {
}

pub fn JsString::to_string(str : JsString) -> String {
let buffer = Buffer::new()
let buffer = StringBuilder::new()
str.iter(fn(i : Int) { buffer.write_char(Char::from_int(i)) })
buffer.to_string()
}

0 comments on commit 5d8ee28

Please sign in to comment.