visitSimpleEventHandler method

  1. @override
Expression visitSimpleEventHandler(
  1. SimpleEventHandler handler, [
  2. OutputType? _
])
override

Implementation

@override
o.Expression visitSimpleEventHandler(ir.SimpleEventHandler handler, [_]) {
  var expr = _convertToExpression(handler);
  if (expr is o.InvokeMethodExpr) {
    var tearOff = _tearOffSimpleHandler(expr);
    return _wrapHandler(tearOff, handler.numArgs);
  }
  final message = 'Expected method for event binding.';
  throw BuildError.withoutContext(
    handler.sourceSpan?.message(message) ?? message,
  );
}