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.

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 / 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>{renderResult(props.output.value)}</pre>
          
        );
      } else {
        return (
          
            <pre>{props.output.consoleLogs.join('\n')}</pre>
            <pre>{renderResult(props.output.value)}</pre>
          
        );
      }
    case 'errors':
      if (props.output.consoleLogs.length === 0) {
        return (
          
            <pre>{parseError(props.output.errors)}</pre>
          
        );
      } else {
        return (
          
            <pre>{props.output.consoleLogs.join('\n')}</pre>
            <br>
            <pre>{parseError(props.output.errors)}</pre>
          
        );
      }
    default:
      return '';
  }
};