W3cubDocs

/Dart 2

run<R> method

R run <R>(R action())

Executes action in this zone.

By default (as implemented in the root zone), runs action with current set to this zone.

If action throws, the synchronous exception is not caught by the zone's error handler. Use runGuarded to achieve that.

Since the root zone is the only zone that can modify the value of current, custom zones intercepting run should always delegate to their parent zone. They may take actions before and after the call.

Implementation

R run<R>(R action());

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