bun_sm 0.1.0

SpiderMonkey-backed API compatibility layer replacing bun_jsc
docs.rs failed to build bun_sm-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

SpiderMonkey-backed API compatibility layer replacing bun_jsc.

bun_sm provides the same public API surface as the phantom bun_jsc crate, but backed by SpiderMonkey via bao_engine + mozjs. When bun_runtime changes pub use bun_jsc::* to pub use bun_sm::*, all 8,500+ JSC references resolve to SM-backed implementations.

Architecture

JSC types map to SM equivalents:

  • JSGlobalObject*mut JSContext (SM's JSContext owns the heap)
  • JSValue → newtype over bun_sm::value::JsValue
  • CallFrame → wrapper over SM CallArgs
  • VirtualMachine → TLS singleton wrapping BaoEventLoop
  • JSPromise → ZST wrapping *mut JSObject

ABI difference

JSC: unsafe extern "C" fn(*mut JSGlobalObject, *mut CallFrame) -> JSValue
SM:  unsafe extern "C" fn(*mut JSContext, argc: u32, vp: *mut JSVal) -> bool