2021-01-12 02:13:41 +09:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
2021-02-05 03:48:32 +05:30
|
|
|
"use strict";
|
2020-07-19 19:49:44 +02:00
|
|
|
|
|
|
|
((window) => {
|
2020-09-16 22:22:43 +02:00
|
|
|
const core = window.Deno.core;
|
2020-07-19 19:49:44 +02:00
|
|
|
|
2020-09-12 19:53:57 +10:00
|
|
|
function opFormatDiagnostics(diagnostics) {
|
2021-04-12 21:55:05 +02:00
|
|
|
return core.opSync("op_format_diagnostic", diagnostics);
|
2020-07-19 19:49:44 +02:00
|
|
|
}
|
|
|
|
|
2021-09-18 14:40:04 +01:00
|
|
|
function opFormatFileName(location) {
|
|
|
|
return core.opSync("op_format_file_name", location);
|
|
|
|
}
|
|
|
|
|
2020-07-19 19:49:44 +02:00
|
|
|
function opApplySourceMap(location) {
|
2021-04-12 21:55:05 +02:00
|
|
|
const res = core.opSync("op_apply_source_map", location);
|
2020-07-19 19:49:44 +02:00
|
|
|
return {
|
|
|
|
fileName: res.fileName,
|
|
|
|
lineNumber: res.lineNumber,
|
|
|
|
columnNumber: res.columnNumber,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
window.__bootstrap.errorStack = {
|
|
|
|
opFormatDiagnostics,
|
2021-09-18 14:40:04 +01:00
|
|
|
opFormatFileName,
|
|
|
|
opApplySourceMap,
|
2020-07-19 19:49:44 +02:00
|
|
|
};
|
|
|
|
})(this);
|