Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage zerojs.package·originates fromworld f63c1fe3-4…

api

The ZeroJS public API: zerojs.new/eval, VM run/get/set, sentinels, and version. The package root init.luau re-exports this module.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 4mo ago
What it does

api

The ZeroJS public API: zerojs.new/eval, VM run/get/set, sentinels, and version. The package root init.luau re-exports this module.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

strict

resetLoop(loop: any) → void

Reset the loop to a clean state at a run boundary: drop every armed timer and forget any recorded unhandled rejections. A run reports only the rejections it itself produced, and a rejection reported once is consumed — so the next run starts from an empty loop rather than inheriting the prior run's stale state. This is the cleanup both vm:run and vm:runAsync apply when a run starts and when it finishes (settle, refusal, or error).

argtypedescription
loopany

renderError(rt: any, jsErr: any) → void

Render a thrown JS Error value into the message text `vm:run` raises. The first line is the tagged "<Name>: <message>"; the remaining lines are the captured stack frames read from the error's own "stack" property.

argtypedescription
rtany
jsErrany

renderUnhandled(rt: any, loop: any) → void

Render the earliest still-unhandled rejection on `loop` into the message and structured payload `vm:run`/`vm:runAsync` surface, or nil when none remains. The policy is first-wins: the head of the list is the earliest rejection a handler never claimed.

argtypedescription
rtany
loopany

recordBail(sourceName: string, reason: string) → void

argtypedescription
sourceNamestring
reasonstring

compiledChunk(self: Vm, src: string, sourceName: string) → void

Resolve a source string to a compiled-tier chunk per the VM's engine mode. Returns the runnable chunk, or nil when this run must use the interpreter: "interp" always, or "auto" when compilation bailed (recorded loudly; a plain syntax error is not a bail — the interpreter raises the same error). In strict "compiled" mode a failed compile raises.

argtypedescription
selfVm
srcstring
sourceNamestring

runCompiled(self: Vm, chunk: (any) → void

Execute a compiled chunk against the VM's realm, global object, and the interpreter's global env cells (the same value model and the same script scope, so state persists across runs and mixes freely between tiers). Returns interpreter-shaped (ok, jsValueOrError). A raw Luau error inside compiled code is an engine defect, not a JS throw, and re-raises — except native stack exhaustion, which surfaces as the JS RangeError it is.

argtypedescription
selfVm
chunk(any

currentStack( ) → void

Error stacks constructed during this run carry the run's source name. Compiled frames carry no per-call bookkeeping, so the stack is a single synthetic frame naming the compiled source.

run(self: Vm, src: string, opts: { sourceName: string? }?) → any

argtypedescription
selfVm
srcstring
opts{ sourceName: string? }?

eval(self: Vm, src: string, opts: { sourceName: string? }?) → any

Evaluate `src` against the live loop without disturbing scheduled work: armed timers stay armed and recorded unhandled rejections stay recorded. This is the inspection path for a VM that is mid-flight — a console command against a running app session — where `vm:run`'s run-boundary reset would silently kill the app's pending timers. The script itself must complete synchronously: a script that parks its own coroutine raises (with the loop untouched). Work the script schedules onto the loop (timers, promise chains) is left in place for the session's own pump to drive.

argtypedescription
selfVm
srcstring
opts{ sourceName: string? }?

runAsync(self: Vm, src: string, opts: { timeoutMs: number? }?) → RunHandle

Execute `src` like `vm:run` but, instead of refusing a script that leaves asynchronous work pending, drive it to completion by pumping the VM loop once per engine frame. Returns a handle whose `task.spawn` driver runs `loop:runDueTimers(rt.nowMs())` then `loop:drainMicrotasks()` each frame and settles the handle when the script's completion value has settled (awaiting it when it is a promise) and no loop work remains, or when an uncaught error or unhandled rejection surfaces, or when `opts.timeoutMs` elapses. On timeout or error the handle rejects with the rendered message (a timeout message contains "timeout"); the pump then stops and cancels any armed timers so the loop is left clean for the next run. The handle is awaitable from a yieldable Luau context via `handle:await()`, which polls `handle.done` frame-by-frame without busy-waiting. Only one runAsync may be in flight on a given VM at a time. A second call while the first has not yet settled raises immediately with a message containing "already in flight" and "runAsync". Sequential calls — each after the previous handle has settled — are supported and keep working.

argtypedescription
selfVm
srcstring
opts{ timeoutMs: number? }?

awaitHandle(selfHandle: RunHandle, maxFrames: number?) → RunHandle

Yield the calling (yieldable) context frame-by-frame until this handle settles, then return it. Polling `done` across `task.wait()` frames lets the driver's own per-frame pump make progress between checks.

argtypedescription
selfHandleRunHandle
maxFramesnumber?

finish(ok: boolean, value: any, errText: string?, payload: LastError?) → void

Resolve/reject the handle exactly once, then leave the loop clean: any timer still armed (an interval mid-flight on timeout, a pending one-shot) is cleared and the unhandled-rejection list is forgotten so no orphaned callback runs after settlement, a reported rejection is consumed, and a following run on this VM starts from an empty loop.

argtypedescription
okboolean
valueany
errTextstring?
payloadLastError?

currentStack( ) → void

considerCompletion( ) → void

pump( ) → void

evalModule(self: Vm, source: string, opts: { id: string, resolve: (string, string) → void

Evaluate a module graph rooted at `source` under `opts.id`, resolving each import through `opts.resolve(specifier, importerId)` (which returns `{ id, source }` or nil for an unresolvable specifier). Returns the root module's namespace object: a frozen-lite object keyed by the module's exported names, with export values snapshotted at completion. The per-VM registry keys evaluated modules by id, so a repeated id returns the cached namespace without re-running the body, and a module that threw re-raises its cached error. A thrown JS error (cycle, unresolved specifier, submodule parse failure, or a module body throw) surfaces the rendered message and structured `lastError`, mirroring `vm:run`. evalModule is synchronous: a graph that leaves timers or a suspended coroutine pending is refused, since top-level `await` is a SyntaxError in module mode and cannot legitimately suspend a body.

argtypedescription
selfVm
sourcestring
opts{ id: string, resolve: (string, string

get(self: Vm, name: string) → any

argtypedescription
selfVm
namestring

set(self: Vm, name: string, v: any) → void

argtypedescription
selfVm
namestring
vany

new(opts: { stepBudget: number?, env: { [string]: any }?, engine: string?, console: globals.ConsoleSinks? }?) → Vm

Build a fresh VM: a realm, its installed global object, and a global env bound to that object. `opts.env` seeds marshaled host values as globals; `opts.stepBudget` bounds each run. `opts.console` supplies the writers the VM's console uses, by level (`log`, `info`, `debug`, `warn`, `error`): each receives the formatted text of one call, untagged. A level without a writer uses `log`'s; with no writers the console writes tagged lines to the engine log.

argtypedescription
opts{ stepBudget: number?, env: { [string]: any }?, engine: string?, console: globals.ConsoleSinks? }?

eval(src: string) → any

Run one source string on a fresh VM and return its marshaled completion.

argtypedescription
srcstring

lastError(vm: Vm) → LastError

The structured payload of the most recent JS error a run raised on `vm`, or nil if the last run completed normally.

argtypedescription
vmVm
⌬ Types
LastError = {RunHandle = {Vm = {

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

46+items
❒
package · born here
❒asset
ZeroJS is a JavaScript interpreter for the Zero engine, written in Luau. It parses and executes ES2017-practical JavaScript entirely inside the Luau VM — no native code, no WebAssembly, no external dependency — and marshals values back to Luau transparently. ## Importing ```luau local zerojs = require("~zerojs.api") ``` `~zerojs` is this package's alias, registered from the `name` in its `package.yaml` wherever the package sits. The same spelling therefore works from the world that authors the package and from a world that installed it, at any depth. Every module is reachable the same way — `~zerojs.parser`, `~zerojs.stdlib.promise` — and the package's own modules reference each other with those ids. ## API surface ### Module-level | Symbol | Type | Description | |--------|------|-------------| | `zerojs.eval(src)` | `(string) -> any` | Parse and execute `src` in a fresh one-shot VM. Returns the marshaled JS completion value. Raises a Luau error on a JS exception. | | `zerojs.new(opts?)` | `(table?) -> VM` | Create a persistent VM. `opts.env` seeds additional JS globals from a Luau table. `opts.engine` picks the tier (`"auto"`, `"compiled"`, `"interp"`). `opts.console` is a table of writers by level (`log`, `info`, `debug`, `warn`, `error`): each receives the formatted text of one console call, untagged, and a level without a writer uses `log`'s. With no `opts.console`, the console writes `[zerojs]`-tagged lines to the engine log. | | `zerojs.null` | sentinel | The JS `null` value (distinct from Luau `nil`). | | `zerojs.undefined` | sentinel | The JS `undefined` value, which marshals to Luau `nil` when returned. | | `zerojs.version` | `string` | Version string of this package. | | `zerojs.lastError(vm)` | `(VM) -> table?` | Returns the structured payload `{ name, message, stack }` from the most recent JS exception on `vm`. `nil` if no exception has occurred on that VM. | ### VM instance | Method | Description | |--------|-------------| | `vm:run(src, opts?)` | Execute `src` in this VM's persistent realm. `opts.sourceName` names the source for error messages and stack frames. Returns the marshaled completion value. Raises directing to `runAsync` when the script leaves a timer armed or a coroutine suspended across a frame. | | `vm:runAsync(src, opts?)` | Execute `src`, driving its event loop across engine frames until it settles. Returns a `RunHandle` immediately. `opts.timeoutMs` rejects the run if it outlasts that many milliseconds. Only one `runAsync` may be in flight per VM at a time; a second call while the first is unsettled raises. | | `vm:get(name)` | Read a global from the VM's realm. | | `vm:set(name, value)` | Write a marshaled Luau value as a JS global in the VM's realm. | ### `RunHandle` (returned by `vm:runAsync`) | Field | Description | |-------|-------------| | `done` | `false` until the run reaches a terminal state, then `true`. | | `ok` | Once `done`, `true` for a resolved run and `false` for a rejection or timeout. | | `value` | The marshaled completion value on a resolved run. A run that timed out after its script had already completed with a value (an armed `setInterval`, say, kept the run open) keeps that value here; every other failure leaves it `nil`. | | `error` | The rendered message text on a rejected or timed-out run. | | `lastError` | The structured `{ name, message, stack }` payload for a failed run. | | `thread` | The engine `task.spawn` driver pumping the loop each frame — present only while the run is still pumping, and `nil` once the run settles on its arming frame (a synchronous or microtask-only completion needs no per-frame driver). | | `handle:await(maxFrames?)` | From a yieldable Luau context, poll `done` frame-by-frame until the handle settles, then return it. | A `runAsync` stays pending while the loop has work: an armed `setInterval` keeps it pending exactly as an un-`unref`'d handle keeps Node alive — clear the interval or bound the run with `timeoutMs`. ## Marshaling Luau values passed to `opts.env` or `vm:set` are converted to JS values. JS values returned from `run`/`eval` are converted back to Luau: numbers, strings, and booleans are transparent; arrays become 1-based Luau tables; objects become string-keyed Luau tables; JS functions become callable Luau closures; `undefined` becomes `nil`; `null` becomes `zerojs.null`. ## Step-budget sandbox Each VM runs with a default execution budget of 1,000,000 interpreter steps. A script that exceeds the budget raises a JS `RangeError: step budget exceeded`, which surfaces as a Luau error. The budget resets on each `run`/`eval` call. ## Language scope - Variable declarations: `var` (function-scoped hoisting), `let` and `const` with full TDZ enforcement - Functions: declarations, expressions, arrow functions, closures, rest parameters, default parameters - Classes: declarations and expressions, inheritance via `extends`, `super()` in constructors and methods, getter and setter accessors, instance fields, static fields and methods, computed method keys, named class expressions, TDZ before declaration - Destructuring: object and array patterns in declarations, assignment, and function parameters; nested patterns; rename, default, rest; computed keys in object patterns; elision in array patterns - Spread: array literals, call arguments, `new` arguments, object literals - Template literals (untagged) - Optional chaining: `a?.b`, `a?.[k]`, `f?.(x)`. A `null` or `undefined` base ends the whole chain with `undefined` and skips every later link and argument; parentheses end the chain; the chain is not an assignment, update or `new` target - Nullish coalescing `??` and the logical assignments `??=`, `||=` and `&&=`, which evaluate the right side and write only when the current value calls for it. `??` does not mix with `||` or `&&` without parentheses - Full coercion and equality semantics: `==`/`!=` abstract equality, `===`/`!==` strict equality, `typeof`, `instanceof` - `try`/`catch`/`finally`, `throw` - All loop forms: `for`, `while`, `do-while`, `for-in`, `for-of`; `switch` with fallthrough - `async`/`await` — real event-loop semantics: an async function returns a promise, runs synchronously up to the first `await`, and resumes from a microtask when its awaited operand settles - Property enumerability: `for-in` yields only own enumerable keys; object rest excludes prototype methods ### Asynchrony and the event loop - `Promise` with the full ES surface: `then`/`catch`/`finally`, `resolve`/`reject`, and the combinators `all`, `allSettled`, `race`, and `any` (with `AggregateError` when every input to `any` rejects) - `queueMicrotask` for scheduling a microtask directly - Timers: `setTimeout`/`clearTimeout` and `setInterval`/`clearInterval`, with extra arguments forwarded to the callback - `vm:runAsync(src, opts?)` drives a script's timers, microtasks, and promise settlements across engine frames and returns a `RunHandle` (see the VM table above) - A long synchronous loop under `runAsync` yields at each step-budget boundary and resumes on a later frame instead of raising `RangeError`; the same script under `vm:run` still raises ### Standard library - `Object`: callable coercion plus `keys`, `values`, `entries`, `assign`, `freeze`, `isFrozen`, `create`, `getPrototypeOf`, `defineProperty`, `fromEntries`, `hasOwn`, and the `Object.prototype` methods (`hasOwnProperty`, `toString`, `isPrototypeOf`) - `Function.prototype`: `call`, `apply`, `bind` - Global conversions and predicates: `parseInt`, `parseFloat`, `isNaN`, `isFinite`, `String`, `Number`, `Boolean` - `Array` and `Array.prototype`: construction, `isArray`, `from`, `of`, and the iteration/mutation/query methods (`map`, `filter`, `reduce`, `forEach`, `find`, `some`, `every`, `slice`, `splice`, `concat`, `join`, `indexOf`, `includes`, `sort`, `reverse`, `push`, `pop`, `shift`, `unshift`, `flat`, `fill`, `keys`, `values`, `entries`) - `String.prototype`: `slice`, `substring`, `substr`, `split`, `indexOf`, `includes`, `startsWith`, `endsWith`, `repeat`, `padStart`, `padEnd`, `trim`, `trimStart`, `trimEnd`, `toUpperCase`, `toLowerCase`, `charAt`, `charCodeAt`, `codePointAt`, `at`, `concat`, `replace`, `replaceAll`, `match`, `matchAll`, `search` - `Number`: `isInteger`, `isSafeInteger`, `isFinite`, `isNaN`, `parseFloat`, `parseInt`, `MAX_SAFE_INTEGER`, `MIN_SAFE_INTEGER`, `MAX_VALUE`, `MIN_VALUE`, `EPSILON`, `POSITIVE_INFINITY`, `NEGATIVE_INFINITY`, `NaN`, and `Number.prototype` (`toFixed`, `toString`, `toPrecision`) - `Math`: the constants and functions (`abs`, `floor`, `ceil`, `round`, `trunc`, `sign`, `min`, `max`, `pow`, `sqrt`, `cbrt`, `hypot`, `exp`, `log`, `log2`, `log10`, the trig family, `random`) - `Date`: construction as `new Date()` (now) and `new Date(ms)` (epoch milliseconds), `now` (the wall clock at the moment of the call, never ahead of it and never moving backwards; whole-second readings of the wall clock bound it until a reading crosses a second boundary), `getTime`, `getFullYear`, `getMonth`, `getDate`, `getHours`, `getMinutes`, `getSeconds`, `getMilliseconds`, `getDay`, `toISOString`, `toJSON` - `JSON`: `parse` and `stringify` (indent argument and array replacer whitelist) - `Map` and `Set`: construction from iterables, `get`/`set`/`has`/`delete`/`clear`, `add`, `size`, `forEach`, `keys`, `values`, `entries`, insertion-order iteration - `RegExp`: literals and the constructor, `test`, `exec`, `lastIndex`, `source`, `flags`, `global`, `ignoreCase`, `multiline`, `dotAll`, and the `String` regex methods above - Errors: `Error`, `TypeError`, `RangeError`, `ReferenceError`, `SyntaxError` constructors and inheritance; `Error.prototype.name`, `message` and `toString`, so `String(e)`, `${e}` and `"" + e` read `<name>: <message>` - `console`: `log`, `info`, `debug`, `warn`, `error`, `dir` and `assert`. Values print the way a JavaScript console prints them: strings bare at the top and quoted inside, `{ a: 1, b: [ 1, 2 ] }`, `Map(1) { 'a' => 1 }`, `[Function: f]`, errors as `Error: message`, nested values below depth 2 as `[Object]` and `[Array]`, arrays and collections cut after 100 entries, a self-containing value as `<ref *1> { self: [Circular *1] }`, and a rendering wider than 80 characters across lines. A leading `%s`, `%d`, `%i`, `%f`, `%j`, `%o`, `%O`, `%c` or `%%` formats the arguments after it - `performance.now()` (milliseconds on a monotonic clock since the VM was created) and `performance.timeOrigin` - `globalThis`, `NaN`, `Infinity` ### Out of scope by design - Generators and iterators (`function*`, `yield`) - `Proxy` and `Reflect` - Labeled statements and `with` - Tagged template literals The full divergence list — where ZeroJS behavior differs from a browser engine — lives in the guide's divergence section. ## Test suites Eleven suites ship with the package, in its `tests/` folder, run via `tools.tests.run`: ```luau tools.tests.run({ suite = "zerojs_lexer" }) -- tokenization tools.tests.run({ suite = "zerojs_parser" }) -- AST construction and error recovery tools.tests.run({ suite = "zerojs_semantics" }) -- runtime semantics end-to-end tools.tests.run({ suite = "zerojs_language" }) -- ?., ??, logical assignment, error text, console, Date.now, performance.now tools.tests.run({ suite = "zerojs_stdlib" }) -- the standard-library surface tools.tests.run({ suite = "zerojs_typed_arrays" }) -- typed arrays, ArrayBuffer, DataView tools.tests.run({ suite = "zerojs_regex" }) -- the regex engine and RegExp methods tools.tests.run({ suite = "zerojs_async" }) -- the event loop, promises, and timers tools.tests.run({ suite = "zerojs_modules" }) -- the module graph tools.tests.run({ suite = "zerojs_assettype" }) -- the zJs asset type tools.tests.run({ suite = "zerojs_smoke" }) -- unmodified real-world JS programs ```
▲ 1↑ born
▣
module · born here
❒asset
# values The JavaScript value model: the `undefined` and `null` sentinels, their predicates, and `jsTypeof`, which classify the primitive and reference values the interpreter operates on.
▲ 0↑ born
▣
module · born here
❒asset
# globals The minimal global surface installed onto a VM's global JS object. `globals.install(rt, globalObj)` seeds `globalThis` (a self-reference), the `undefined`/`NaN`/`Infinity` values, a `console` with `log`/`warn`/`error` bound to the engine log (every line prefixed `[zerojs]`), `Object` (callable, with `Object.keys`), `Array` (with `Array.isArray`), and the `Error`, `TypeError`, `RangeError`, `ReferenceError` and `SyntaxError` constructors. Each error constructor is callable with and without `new`; instances carry the class prototype, own `name`/`message`/`stack`, and a stack captured from the interpreter's live call stack at construction, so `instanceof Error` holds for every subclass. Function `name` and `length` and prototype `constructor` are non-enumerable, following the realm's enumerability model.
▲ 0↑ born
▣
module · born here
❒asset
# compiler Compiles JavaScript source (parsed by `zerojs.parser`) to Luau source that executes against the same realm value model as the interpreter (`zerojs.runtime`). Objects, prototypes, the stdlib, promises, typed arrays and the bridge are shared between tiers, so compiled and interpreted code interoperate freely on one VM: bindings persist across runs, either tier can call functions the other created, and host marshaling behaves identically. The speed comes from eliminating the interpreter's per-node dispatch and environment lookups: JS statements become plain Luau control flow, locals become Luau locals, and array element access rides the runtime's dense integer-indexed storage (`rt.iget`/`rt.iset`). Surface: - `compile(source, sourceName?) -> (luauSource?, err?)` — translate a program. - `load(source, sourceName?) -> (chunk?, err?)` — translate and load; the chunk takes the runtime companion as its argument. - `makeRtc(rt, globalObj, globalEnv?)` — build the runtime companion binding the JS-semantics operations (operators, member access, calls, classes, destructuring, async/generators, step budgets) to a realm. - `runOn(rt, globalObj, source, sourceName?)` — compile and run against a realm, returning the JS completion value. Coverage spans the language the parser accepts: expressions and operators with JS coercion semantics, control flow (including switch fall-through and labeled-free break/continue), functions, closures, arrow functions with lexical `this`, `arguments`, destructuring with defaults and rest, template literals, regex literals, classes (inheritance, `super`, accessors, fields, static members), try/catch/finally across loop and return boundaries, async/await on the VM event loop, and generators. A construct outside the covered set raises `compile bail: <node>`; `zerojs.api`'s auto engine then runs that program on the interpreter and records the bail.
▲ 0↑ born
▣
module · born here
❒asset
# interpreter The tree-walking evaluator: `interpreter.run(ast, opts)` executes a parsed program against a realm, resolving scopes and closures, driving statements and expressions, and enforcing the per-run step budget.
▲ 0↑ born
▣
module · born here
❒asset
# modules.module The ES module graph for zerojs: evaluate-once semantics, namespace objects, and cycle detection, parameterized by a host resolver so it stays asset-agnostic. `evaluate` walks the dependency graph depth-first from a root id, evaluating each module body once through the interpreter's module entry and caching the frozen namespace in a per-VM registry keyed by id. `vm:evalModule` is the public entry.
▲ 0↑ born
▣
module · born here
❒asset
# parser The JavaScript parser: `parser.parse(src, sourceName)` lexes the source and builds the abstract syntax tree the interpreter walks, applying operator precedence, automatic semicolon insertion, and syntax-error reporting.
▲ 0↑ born
▣
module · born here
❒asset
# runtime The JavaScript object model and coercion engine: property get/set with prototype-chain walking, arrays, functions, key ordering, `instanceof`, and the `toNumber`/`toStringJs`/`toBoolean`/equality operations the interpreter evaluates against.
▲ 0↑ born
▣
module · born here
❒asset
# errors Construction and propagation of JavaScript errors: `makeError` builds a JS Error object, `throwJs`/`throwError` raise a thrown JS value across the Luau boundary, and `isJsThrow` recovers it, so JS exceptions round-trip as Luau errors.
▲ 0↑ born
▣
module · born here
❒asset
# event_loop.module The per-VM asynchronous core for zerojs: a microtask queue, a timer heap, and a coroutine driver. One loop is built per VM as `event_loop.new(rt)`, where `rt` is the realm (used only for its `nowMs` clock). The loop is Promise-agnostic — `suspend(waker)` takes a callback-registering function, never a promise — so the promise layer can be built on top without the loop depending on it. ## Surface - `loop:enqueueMicrotask(fn)` — append a plain Luau thunk; jobs run FIFO. - `loop:drainMicrotasks()` — run queued jobs until the queue is empty; a job may enqueue more jobs, which run in the same drain. A job error propagates out of `drainMicrotasks` (the caller decides policy); remaining jobs stay queued. - `loop:setTimer(fn, delayMs) -> id` — one-shot timer due at `nowMs + max(0, delayMs)`. - `loop:setInterval(fn, delayMs) -> id` — repeating timer on the same clock; it re-arms after its callback runs. - `loop:clearTimer(id)` — cancels a one-shot or interval; an unknown id is a no-op. - `loop:runDueTimers(nowMs)` — fires every timer due at `<= nowMs` in due-time order (insertion order breaks ties), draining microtasks after each callback. - `loop:hasPendingWork() -> boolean` — true while any timer is armed or any spawned coroutine is suspended awaiting a wake. - `loop:spawn(fn, ...) -> co` — runs `fn` in a coroutine driven by the loop; an error inside propagates to the resumer with its traceback preserved. - `loop:suspend(waker)` — callable only from inside a loop-spawned coroutine. Registers the coroutine as suspended and yields. `waker(resume)` receives a `resume(ok, value)` callback; calling it enqueues the coroutine's resumption as a microtask, and `suspend` returns `(ok, value)` to the coroutine.
▲ 0↑ born
▣
module · born here
❒asset
# bridge Marshaling between Luau host values and a realm's JavaScript value model. `bridge.toJs(rt, luauValue)` lifts a Luau value into JS; `bridge.toLuau(rt, jsValue)` lowers a JS value back into Luau. Numbers, strings and booleans pass through both ways. Luau `nil` becomes `values.undefined`; `values.undefined` becomes `nil` and `values.null` returns the sentinel itself. A dense integer-keyed Luau table becomes a 0-based JS array; any other plain table becomes a JS object. Luau functions become JS functions (and vice versa), calling back across the boundary with arguments and return values marshaled. Tables carrying a metatable and userdata are opaque host handles, wrapped in a private JS field and unwrapped back to the original on the return trip, so values like AssetRefs survive round trips. Both directions are deep and cycle-safe: a per-call seen-map yields one result container per source container.
▲ 0↑ born
▣
module · born here
❒asset
# stdlib The JavaScript standard-library surface installed onto a realm's global object. `stdlib.install(rt, globalObj)` applies each submodule installer. `object.luau` owns the `Object` callable and its statics, `Object.prototype`, `Function.prototype` (call/apply/bind), a minimal `Number.prototype.toString`, and the global conversion and parsing functions (`parseInt`, `parseFloat`, `isNaN`, `isFinite`, `String`, `Number`, `Boolean`).
▲ 0↑ born
backing path · zerojs.package/api.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.