How to use the js-slang/dist/stdlib/inspector.manualToggleDebugger function in js-slang

To help you get started, we’ve selected a few js-slang examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github source-academy / cadet-frontend / src / sagas / workspaces.ts View on Github external
paused: take(actionTypes.BEGIN_DEBUG_PAUSE)
  });

  if (interrupted) {
    interrupt(context);
    /* Redundancy, added ensure that interruption results in an error. */
    context.errors.push(new InterruptedError(context.runtime.nodes[0]));
    yield put(actions.debuggerReset(workspaceLocation));
    yield put(actions.endInterruptExecution(workspaceLocation));
    yield call(showWarningMessage, 'Execution aborted', 750);
    return;
  }

  if (paused) {
    yield put(actions.endDebuggerPause(workspaceLocation));
    lastDebuggerResult = manualToggleDebugger(context);
    yield updateInspector(workspaceLocation);
    yield call(showWarningMessage, 'Execution paused', 750);
    return;
  }

  if (actionType === actionTypes.EVAL_EDITOR) {
    lastDebuggerResult = result;
  }
  yield updateInspector(workspaceLocation);

  if (result.status !== 'suspended' && result.status !== 'finished') {
    yield put(actions.evalInterpreterError(context.errors, workspaceLocation));
    return;
  } else if (result.status === 'suspended') {
    yield put(actions.endDebuggerPause(workspaceLocation));
    yield put(actions.evalInterpreterSuccess('Breakpoint hit!', workspaceLocation));