interop/js

模块 Zio wrapper over the native JavaScript engine. The engine crosses by · 8 个符号

value for primitives and by opaque handle for objects; every rule the boundary enforces is re-exported here so Zio code reads as one surface.

Values: integers inside JS's safe range are exact, a BigInt above it stays exact as an integer, non-finite numbers are refused by name, and an object crosses as a #js<engine>:<slot> handle the engine owns.

概览

new-engine

(defn new-engine …)

无文档。

eval

(defn eval [engine source] …)

无文档。

call

(defn call [engine fn-handle & args] …)

无文档。

invoke

(defn invoke [engine obj-handle method-handle & args] …)

Call a method with its receiver, the way JS reached it.

get

(defn get [engine obj-handle property] …)

无文档。

put

(defn put [engine obj-handle property value] …)

无文档。

on

(defn on [engine name callback] …)

无文档。

eval-property

(defn eval-property [engine source property] …)

Convenience: evaluate a source string and read one property in one step, the common "call into JS" shape.