W3cubDocs

/Dart 2

apply method

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

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.

Implementation

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

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-mirrors/ClosureMirror/apply.html