Skip to content

Commit cc73f43

Browse files
fix: update extern type syntax
1 parent a10c8de commit cc73f43

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

legacy/examples/snake/extern/string.wasm.mbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
priv type JsArray
15+
priv extern type JsArray
1616

1717
fn JsArray::new() -> JsArray = "array" "new"
1818

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

21-
pub(all) type JsString
21+
pub(all) extern type JsString
2222

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

legacy/examples/snake/lib/draw.mbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
pub(all) type Canvas_ctx
15+
pub(all) extern type Canvas_ctx
1616

1717
fn body_color(grid : GridType) -> String {
1818
match grid {

next/language/error_codes/E4042.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ you can pass the int one by one to the host function and store the array on the
2626
JS side.
2727

2828
```moonbit
29-
type JsArray
29+
extern type JsArray
3030
fn make_js_array() -> JsArray = "mod" "make_js_array"
3131
fn push_js_array(array : JsArray, value : Int) -> Unit = "mod" "push_js_array"
3232
```

0 commit comments

Comments
 (0)