wrap<T> static method
Runs callback
with context
as the current HookContext.
This method should only be used by HookContext implementations.
Implementation
static T wrap<T>(HookContext context, T Function() callback) {
_stack.add(context);
try {
return callback();
} finally {
_stack.removeLast();
}
}