JsFunction.withThis constructor

JsFunction.withThis(Function f)

Returns a JsFunction that captures its 'this' binding and calls f with the value of JavaScript this passed as the first argument.

Implementation

factory JsFunction.withThis(Function f) {
  var jsFunc = _convertDartFunction(f, captureThis: true);
  return JsFunction._fromJs(jsFunc);
}