Repository navigation
v1.0.0
SafeScript v1.0.0
First stable release.
Language: Safe computational subset of JavaScript (ES8 base + nullish coalescing, optional chaining, BigInt, destructuring, spread). No eval, new, this, class, delete, import, async, await, or prototype access.
Auto-async model: All calls are automatically awaited. Injected async methods work transparently without async/await keywords in source.
Execution guards: Compiler injects __check() at every function entry and loop iteration. Infinite loops and infinite recursion terminate immediately. Hardcoded ceilings: 60s timeout, 100M operations — always enforced.
Hooks: beforeCall/afterCall intercept every call to injected scope functions. Suppress, short-circuit, transform args/results, or throw. Dotted path names for nested scope ("db.query"). Primary mechanism for host-side resource throttling.
.safe file headers: @needs/@uses capability declarations, parsed by SafeScript.capabilities(), validated by SafeScript.checkScope().
Targets: Node.js, browser (9 KB gzipped compiler), PHP, QuickJS/C-embeddable.
Ecosystem: safescript-express (middleware), safescript-cli, safescript-loader (browser auto-loader), safescript-quickjs, safescript-php.
Covered by 1,128 tests across all repos.