setBreakpoint method

Future<SetBreakpointResponse> setBreakpoint(
  1. WipLocation location, {
  2. String? condition,
})

Sets JavaScript breakpoint at a given location.

  • location: Location to set breakpoint in
  • condition: Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.

Implementation

Future<SetBreakpointResponse> setBreakpoint(
  WipLocation location, {
  String? condition,
}) async {
  Map<String, dynamic> params = {
    'location': location.toJsonMap(),
  };
  if (condition != null) {
    params['condition'] = condition;
  }

  final WipResponse response =
      await sendCommand('Debugger.setBreakpoint', params: params);

  if (response.result!.containsKey('exceptionDetails')) {
    throw ExceptionDetails(
        response.result!['exceptionDetails'] as Map<String, dynamic>);
  } else {
    return SetBreakpointResponse(response.json);
  }
}