From 5d8ee286ca160045a630e3bc5953775018c9ae7e Mon Sep 17 00:00:00 2001 From: zihang Date: Tue, 3 Dec 2024 17:52:29 +0800 Subject: [PATCH] fix(example): update grammar for wasm backend --- legacy/examples/snake/extern/string.wasm.mbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/examples/snake/extern/string.wasm.mbt b/legacy/examples/snake/extern/string.wasm.mbt index da6d93a4..cfa5e86e 100644 --- a/legacy/examples/snake/extern/string.wasm.mbt +++ b/legacy/examples/snake/extern/string.wasm.mbt @@ -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" @@ -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() }