How to use the js-slang.parseError 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.

github source-academy / cadet-frontend / src / components / workspace / side-content / AutograderCard.tsx View on Github external
const buildErrorString = (errors: SourceError[]) => {
      return parseError(errors);
    };
github source-academy / cadet-frontend / src / components / workspace / Repl.tsx View on Github external
<Pre className="resultOutput">{renderResult(props.output.value)}</Pre>
          </Card>
        );
      } else {
        return (
          <Card>
            <Pre className="logOutput">{props.output.consoleLogs.join('\n')}</Pre>
            <Pre className="resultOutput">{renderResult(props.output.value)}</Pre>
          </Card>
        );
      }
    case 'errors':
      if (props.output.consoleLogs.length === 0) {
        return (
          <Card>
            <Pre className="errorOutput">{parseError(props.output.errors)}</Pre>
          </Card>
        );
      } else {
        return (
          <Card>
            <Pre className="logOutput">{props.output.consoleLogs.join('\n')}</Pre>
            <br />
            <Pre className="errorOutput">{parseError(props.output.errors)}</Pre>
          </Card>
        );
      }
    default:
      return <Card>''</Card>;
  }
};