Run js blocks in JavaScriptCore without node !411

merged merged by cmc on 2026-11-20 18:38 UTC · krz/orgstar:parity-js into main

Discussion

cmc

Milestone M6 of docs/plans/2026-11-20-parity.md.

  • App Store and iOS builds run js blocks in JavaScriptCore, as a CommonJS file the way ob-js runs node; sessions keep their context.
  • A node shim covers console, util.inspect/format, timers, require of a few core modules, process basics.
  • Node-only code is refused with "This block uses X, which runs only in node": top-level await/import/export, Error.stack, node globals missing from JavaScriptCore (checked against node's own global list), unimplemented members of require, module and process.
  • Developer ID uses node when installed, JavaScriptCore otherwise; a :cmd with arguments still goes to node.

Output is compared with node and with Emacs ob-js. swift test passes; macOS (APPSTORE) and iOS builds compile.