aboutsummaryrefslogtreecommitdiff
path: root/src/app/root.zig
blob: 3d2a82e46d1e7c472977e4edce823a3750e32a41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const std = @import("std");
const z = @import("z");

export fn run() void {
    var env: z.Env = .init(std.heap.wasm_allocator);
    defer env.deinit();

    const console = (env.getProp(z.Env.window, "console") catch unreachable).await(&env, .object);

    const call = env.callMethod(console, "log", .{ "hello, wasm!" }) catch unreachable;

    call.await(&env, .undefined);
}