mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Clean up how we use opIds (#4118)
This commit is contained in:
parent
805992b14a
commit
91b606aaae
74 changed files with 367 additions and 589 deletions
|
@ -1,11 +1,10 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
import { DiagnosticItem } from "./diagnostics.ts";
|
||||
import * as dispatch from "./dispatch.ts";
|
||||
import { sendSync } from "./dispatch_json.ts";
|
||||
|
||||
// TODO(bartlomieju): move to `repl.ts`?
|
||||
export function formatError(errString: string): string {
|
||||
const res = sendSync(dispatch.OP_FORMAT_ERROR, { error: errString });
|
||||
const res = sendSync("op_format_error", { error: errString });
|
||||
return res.error;
|
||||
}
|
||||
|
||||
|
@ -14,5 +13,5 @@ export function formatError(errString: string): string {
|
|||
* @param items An array of diagnostic items to format
|
||||
*/
|
||||
export function formatDiagnostics(items: DiagnosticItem[]): string {
|
||||
return sendSync(dispatch.OP_FORMAT_DIAGNOSTIC, { items });
|
||||
return sendSync("op_format_diagnostic", { items });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue