InterpretedInstance class

Represents an instance of an InterpretedClass at runtime.

Implemented types

Constructors

InterpretedInstance(InterpretedClass klass, {List<RuntimeType>? typeArguments})

Properties

bridgedSuperObject ↔ Object?
The native object created by a bridged superclass constructor.
getter/setter pair
hashCode → int
Honour user-defined hashCode so that interpreted instances slot into native Dart hash structures consistently with their ==. Mirror of tom_d4rt InterpretedInstance.hashCode.
no setteroverride
interpretedStatefulWidget ↔ InterpretedInstance?
getter/setter pair
klass → InterpretedClass
final
nativeProxy ↔ Object?
getter/setter pair
nativeStateProxy ↔ Object?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
runtimeTypeValue → Object
What the script's runtimeType answers. ghissues72: an instance created with type arguments answers with them, Box<int> as Dart prints it, equal to another instance's of the same class and arguments only (InterpretedGenericType). A non-generic instance, and one whose arguments are the class's defaults (Box(), which the interpreter fills with dynamic, or a parameter's bound), answers with its class, as before: in Dart the literal Box denotes exactly that type, so Box().runtimeType == Box holds. It prints Box where Dart prints Box<dynamic>.
no setter
superCallNamedArgs ↔ Map<String, Object?>?
getter/setter pair
superCallPositionalArgs ↔ List<Object?>?
getter/setter pair
thrownStackTrace ↔ StackTrace?
The stack trace recorded when this instance was first thrown, for an instance whose bridged super-object is an Error (SCF39).
getter/setter pair
typeArguments → List<RuntimeType>?
final
valueType → RuntimeType
The runtime type of this value.
no setteroverride

Methods

bindMethodCached(InterpretedFunction method) → Callable
Returns the bound tear-off of method for this instance, allocating it once and reusing it on subsequent accesses. See _boundMethodCache.
collectionShape(InterpreterVisitor? visitor) → Object?
ghissues77: the native object that gives this instance its shape - the native super-object, else the receiver proxy of a dart:collection base or Iterable on its class chain (an IterableBase subclass is read, printed and is-checked as the iterable its proxy is). Null when it has neither.
defaultToStringOver(Object native) → String?
This instance's own default rendering when native — its bridged super-object or proxy — answers Object's default toString, and null when native overrides it (ArgumentError's message is a real answer).
findOperator(String operatorSymbol) → InterpretedFunction?
get(String name, {InterpreterVisitor? visitor}) → Object?
Accesses a property or method of this value.
override
getField(String name) → Object?
getForAccess(String name, {required InterpreterVisitor visitor}) → Object?
get for an explicit property read x.name: a static member is not reachable through an instance in Dart (ghissues77; Slang's static get currentLocale => instance.currentLocale, whose instance currentLocale is inherited, read the static itself).
getForInvocation(String name, {required InterpreterVisitor visitor}) → Object?
get for the callee of a method invocation x.name(...).
getTypeArguments() → List<RuntimeType>?
Get the generic type arguments for this instance
hasInstanceMember(String name) → bool
Non-throwing check: does this instance declare an instance member (field, getter, or method) named name?
invokeNoSuchMethod(InterpreterVisitor visitor, Invocation invocation) → Object?
ghissues46: answers invocation - a member this instance's class does not have - with its noSuchMethod: an interpreted one, else the one a bridged superclass or mixin declares, run on the native object. Returns noNoSuchMethod when the class has neither (Object's noSuchMethod: the caller reports the miss).
isValueCompatibleWithTypeArgument(Object? value, int typeArgumentIndex) → bool
Check if a value is compatible with the expected generic type at the given index
nativeReceiverFor(String bridgedTypeName, InterpreterVisitor? visitor) → Object?
The native object a member inherited from the bridged class bridgedTypeName runs on: the native super-object, else the native proxy, else a receiver proxy for that class (D4.markProxyIsReceiver, ghissues25). Null when there is none.
noReceiverError(String bridgedName, String member) → RuntimeD4rtException
ghissues31: the error for a member this instance's class inherits from the bridged class bridgedName when there is no native object to run it on - neither a native super-object nor a native or receiver proxy. It used to answer null silently (RC-9).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
objectMember(String name) → Object?
What Object itself answers for name on this instance, or null when name is not one of Object's members that can be asked of an instance by name.
recordThrowIfError(StackTrace stackTrace) → void
Records thrownStackTrace if this is the first throw of an instance extending Error; a later throw keeps the first, as Dart does.
set(String name, Object? value, [InterpreterVisitor? visitor]) → void
Sets a property of this value.
override
toString() → String
Dispatches to the script's toString() when there is one, and falls back to _diagnosticString otherwise.
override
validateFieldAssignment(String fieldName, Object? value, RuntimeType? expectedType) → void
Validate that a value can be assigned to a field with a specific generic type constraint

Operators

operator ==(Object other) → bool
Honour user-defined == so that interpreted instances compare correctly inside native Dart collections (e.g. Set<Cell>, Map<Cell, …>).
override

Constants

noNoSuchMethod → const Object
What invokeNoSuchMethod returns when the class has no noSuchMethod of its own.