filmopen_js
Generated by scripts/package_digest.py; regenerate, never edit.
QuickJS-NG, bound for one call at a time. It knows nothing of FilmOpen: the plug-in host (filmopen_plugin_host) gives it a script, a function name, JSON arguments and the data ctx is built from, and answers the script’s requests through a JsDoor.
pure Dart. 3 files, 568 lines under lib/; 60 tests in 2 files. Barrel: lib/filmopen_js.dart.
Depends on
Section titled “Depends on”Nothing of FilmOpen. Third-party: code_assets, ffi, hooks, logging, native_toolchain_c.
Used by
Section titled “Used by”filmopen_plugin_host
Public API
Section titled “Public API”What the barrel exports, file by file. A name is class, enum, mixin, extension, typedef, a top-level function, getter, setter or variable; under a class, its public constructors, fields, getters, setters and methods.
lib/src/js_call.dart
Section titled “lib/src/js_call.dart”- class
JsLimits— The limits of one call.static const longestWall— The longest wall the host may grant one call.const JsLimits({ this.memoryBytes = 64 * 1024 * 1024, this.stackBytes = 1024 * 1024, this.engineTime = const Duration(seconds: 30), this.wallTime =…— The limits every call runs under, each of which a test may shorten.final int memoryBytes— What the runtime may allocate, the requests waiting for the doors included.final int stackBytes— How deep JavaScript may recurse, in bytes of native stack; capped by what the thread really has.final Duration engineTime— JavaScript’s own running time; waiting on a door does not count.final Duration? wallTime— The whole call, waiting included; null removes the wall timer.final int resultBytes— The result’s JSON text, in UTF-8 bytes.final Duration cancelGrace— How long a cancelled call has to end before it is given up as hung.
- class
JsSource— One file of a call’s code: its [name], which is what an error’s position reports, and its text.const JsSource(this.name, this.code)— The file [name] holding [code].final String namefinal String code
- class
JsCall— One call: the script’s files, the function of the last file’s value to call, and the datactxis built from.const JsCall.files({ required this.files, required this.function, this.args, this.withArgs = true, this.context = const {}, this.limits = const JsL…— A call of [function] in [files], loaded in order into the one engine.final List<JsSource> files— The files, in the order they are loaded; never empty.final String functionfinal Object? args— The second argument, as JSON; ignored when [withArgs] is false and the function is called withctxalone.final bool withArgsfinal Map<String, Object?> context— Whatctx’s synchronous members read, includingoperation, the host call’s frame id.final JsLimits limits
- class
JsOutcome— What a call came to.const JsOutcome()
- class
JsValue— The function’s value, as JSON.const JsValue(this.value)— The value the function’s promise settled with.final Object? value
- class
JsFailure— Why the call has no value, as a [code].const JsFailure(this.code, {this.limit, this.message, this.file, this.line, this.column})— A failure with its [code], and [limit], [message] or a position where they apply.final String codefinal String? limitfinal String? messagefinal String? file— The call’s own file the failure came from, and the place in it; null where no frame named one.final int? linefinal int? column
- class
JsDoorRefusal— A door’s refusal, which the script receives as an error with [code] and [reason].const JsDoorRefusal(this.code, {this.reason, this.message, this.stage})— A refusal with its [code], and why where the door says.final String codefinal String? reasonfinal String? message— Words for the person, where the door has some of its own.final String? stage— Where a request door refused:admission, before anything left the machine, ortransport, once it was being sent; null for a door that sends nothing.JsDoorRefusal at(String stage)— This refusal, said to have happened at [stage].
- typedef
typedef JsDoor— Answers the script’s requests with a JSON value, or throws [JsDoorRefusal]. - typedef
typedef JsNote— Told of a door the call’s own isolate answered, which therefore never reaches [JsDoor]:sleepalone today. - typedef
typedef JsDoorFailed— Told of a door that failed other than by [JsDoorRefusal] — at itscall, or at theencodeof its answer — before the script’s rejection is built, so that the host can log a failure the script may catch. - class
JsCancel— Cancels a call from outside it.bool get isCancelledvoid cancel()
- function
Future<JsOutcome> runJs(JsCall call, {required JsDoor doors, JsCancel? cancel, JsNote? note, JsDoorFailed? onDoorFailed})— Runs [call] in an isolate of its own, with a fresh runtime freed after it unless its isolate dies on an error. - variable
const doorNames— The doorsctxhas (the shim’s prelude), and nothing else.
Internal
Section titled “Internal”Files under lib/ the barrel does not reach; nothing outside the package may import them.
lib/src/bindings.dart:fjsOk,fjsWaiting,fjsSettled,fjsFailed,fjsLimit,fjsCreate,fjsDestroy,fjsCancel,fjsLoad,fjsCall,fjsPump,fjsNextRequest, +3