A ClosureMirror reflects a closure.

A ClosureMirror provides the ability to execute its reflectee and introspect its function.

Implements

Properties

function MethodMirror

A mirror on the function associated with this closure.

read-only
hashCode int

Get a hash code for this object.

read-only, inherited
hasReflectee bool

Does reflectee contain the instance reflected by this mirror? This will always be true in the local case (reflecting instances in the same isolate), but only true in the remote case if this mirror reflects a simple value.

read-only, inherited
reflectee → dynamic

If the InstanceMirror reflects an instance it is meaningful to have a local reference to, we provide access to the actual instance here.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited
type ClassMirror

A mirror on the type of the reflectee.

read-only, inherited

Constructors

ClosureMirror()

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

apply(positionalArguments, [Map<Symbol, dynamic> namedArguments]) InstanceMirror

Executes the closure and returns a mirror on the result. Let f be the closure reflected by this mirror, let a1, ..., an be the elements of positionalArguments let k1, ..., km be the identifiers denoted by the elements of namedArguments.keys and let v1, ..., vm be the elements of namedArguments.values. Then this method will perform the method invocation f(a1, ..., an, k1: v1, ..., km: vm) If the invocation returns a result r, this method returns the result of calling reflect\(r\). If the invocation causes a compilation error the effect is the same as if a non-reflective compilation error had been encountered. If the invocation throws an exception e (that it does not catch) this method throws e.

delegate(Invocation invocation) → dynamic

Perform invocation on reflectee. Equivalent to

inherited
getField(Symbol fieldName) InstanceMirror

Invokes a getter and returns a mirror on the result. The getter can be the implicit getter for a field or a user-defined getter method.

inherited
invoke(Symbol memberName, positionalArguments, [Map<Symbol, dynamic> namedArguments]) InstanceMirror

Invokes the named function and returns a mirror on the result.

inherited
noSuchMethod(Invocation invocation) → dynamic

noSuchMethod is invoked when users invoke a non-existent method on an object. The name of the method and the arguments of the invocation are passed to noSuchMethod in an Invocation. If noSuchMethod returns a value, that value becomes the result of the original invocation.

inherited
setField(Symbol fieldName, Object value) InstanceMirror

Invokes a setter and returns a mirror on the result. The setter may be either the implicit setter for a non-final field or a user-defined setter method.

inherited
toString() String

Returns a string representation of this object.

inherited