Env class final

Dart operations on the Node environment supplied to a module's register hook.

Values are borrowed for the duration of a call. Env cannot be sent to another isolate.

Properties

global → JsObject
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

defineClass<T extends Object>(String name, {required T constructor(JsArguments), Map<String, Object? Function(T, JsArguments)> methods = const {}, Map<String, Object? Function(T)> getters = const {}, Map<String, void Function(T, JsArguments)> setters = const {}, Map<String, Object? Function(JsArguments)> staticMethods = const {}, Map<String, Object? Function()> staticGetters = const {}, Map<String, void Function(JsArguments)> staticSetters = const {}, void finalize(T)?}) → JsFunction
Defines a JavaScript class whose instances own Dart objects of type T.
function(String name, Object? body(JsArguments)) → JsFunction
Creates a function that retains body until JavaScript collects it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
object() → JsObject
symbol([String? description]) → JsSymbol
toString() → String
A string representation of this object.
inherited
unwrap<T extends Object>(JsObject value) → T
Gets the Dart object carried by a wrapper from this environment.
withScope<R>(R body()) → R
Opens a temporary handle scope for work outside a registered callback.
wrap<T extends Object>(T value) → JsObject
Returns the JavaScript wrapper for a Dart object of a registered class.

Operators

operator ==(Object other) → bool
The equality operator.
inherited