Function allowInteropCaptureThis(Function f) {
if (JS('bool', 'typeof(#) == "function"', f)) {
// Behavior when the function is already a JS function is unspecified.
throw new ArgumentError(
"Function is already a JS function so cannot capture this.");
return f;
} else {
return _convertDartFunctionFastCaptureThis(f);
}
}
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-js/allowInteropCaptureThis.html