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.
ecma-runtime-cat
ECMAScript runtime built-ins (console.*, Math.*, JSON.*, parseInt, parseFloat, isNaN, isFinite, Number, String, Boolean) for the boa-cat engine.
ecma-runtime-cat is the runtime layer of a comp-cat-rs reformulation of a JavaScript stack targeting Tauri integration. It registers a set of Rust-implemented NativeFn callables into the engine's initial environment so scripts can call standard globals. The same framework constraints apply: no mut, no Rc/Arc, no interior mutability, no panics, exhaustive matches, static dispatch.
Example
use evaluate_program_with;
use Fuel;
use lex;
use parse_script;
use ;
v0 scope
console.log/console.error/console.warn.Math.{abs, floor, ceil, round, sqrt, pow, min, max, log, exp, sin, cos, tan, atan, atan2, random}and constantsMath.{PI, E, LN2, LN10, SQRT2}.JSON.stringify(basic; noreplacerorspaceargument).- Globals:
parseInt,parseFloat,isNaN,isFinite,Number,String,Boolean, plusundefined,NaN,Infinity.
Deferred to v0.2+
JSON.parse.Object.{keys, values, entries, assign}.Array.{isArray, from, of}andArray.prototype.*.String.prototype.*(requires prototype-chain support inboa-cat).Date,Promise,Symbol,Errorconstructor.
Design
Each built-in is a NativeFn (fn(Vec<Value>, Value, Heap, Fuel) -> EvalResult). build_initial() returns a pre-populated (Env, Heap); install(env, heap) folds the runtime onto a caller-supplied env+heap. Downstream callers thread these into boa_cat::evaluate_program_with.
The runtime never panics. Bad inputs surface as Outcome::Throw(Value::String("TypeError: ...")) so script-level try/catch can recover, or as Value::Number(NaN) where ECMA-262 specifies that fallback (parseInt, Number, arithmetic on objects).
License
MIT OR Apache-2.0