summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/diagnostics.rs1
-rw-r--r--cli/dts/lib.deno.unstable.d.ts39
-rw-r--r--cli/tests/unit/error_stack_test.ts16
-rw-r--r--runtime/js/40_error_stack.js5
-rw-r--r--runtime/js/90_deno_ns.js1
5 files changed, 1 insertions, 61 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs
index 24d7ab0e7..1538e5d4d 100644
--- a/cli/diagnostics.rs
+++ b/cli/diagnostics.rs
@@ -39,7 +39,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
"UnixConnectOptions",
"UnixListenOptions",
"addSignalListener",
- "applySourceMap",
"bench",
"connect",
"consoleSize",
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts
index 2904c14f3..fbbe165f9 100644
--- a/cli/dts/lib.deno.unstable.d.ts
+++ b/cli/dts/lib.deno.unstable.d.ts
@@ -895,45 +895,6 @@ declare namespace Deno {
options?: EmitOptions,
): Promise<EmitResult>;
- /** **UNSTABLE**: Should not have same name as `window.location` type. */
- interface Location {
- /** The full url for the module, e.g. `file://some/file.ts` or
- * `https://some/file.ts`. */
- fileName: string;
- /** The line number in the file. It is assumed to be 1-indexed. */
- lineNumber: number;
- /** The column number in the file. It is assumed to be 1-indexed. */
- columnNumber: number;
- }
-
- /** **UNSTABLE**: new API, yet to be vetted.
- *
- * Given a current location in a module, lookup the source location and return
- * it.
- *
- * When Deno transpiles code, it keep source maps of the transpiled code. This
- * function can be used to lookup the original location. This is
- * automatically done when accessing the `.stack` of an error, or when an
- * uncaught error is logged. This function can be used to perform the lookup
- * for creating better error handling.
- *
- * **Note:** `lineNumber` and `columnNumber` are 1 indexed, which matches display
- * expectations, but is not typical of most index numbers in Deno.
- *
- * An example:
- *
- * ```ts
- * const origin = Deno.applySourceMap({
- * fileName: "file://my/module.ts",
- * lineNumber: 5,
- * columnNumber: 15
- * });
- *
- * console.log(`${origin.fileName}:${origin.lineNumber}:${origin.columnNumber}`);
- * ```
- */
- export function applySourceMap(location: Location): Location;
-
export type SetRawOptions = {
cbreak: boolean;
};
diff --git a/cli/tests/unit/error_stack_test.ts b/cli/tests/unit/error_stack_test.ts
index e8d29569f..8444972a8 100644
--- a/cli/tests/unit/error_stack_test.ts
+++ b/cli/tests/unit/error_stack_test.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
-import { assert, assertEquals, assertMatch } from "./test_util.ts";
+import { assertEquals, assertMatch } from "./test_util.ts";
Deno.test(function errorStackMessageLine() {
const e1 = new Error();
@@ -52,17 +52,3 @@ Deno.test(function captureStackTrace() {
}
foo();
});
-
-// FIXME(bartlomieju): no longer works after migrating
-// to JavaScript runtime code
-Deno.test({ ignore: true }, function applySourceMap() {
- const result = Deno.applySourceMap({
- fileName: "CLI_SNAPSHOT.js",
- lineNumber: 23,
- columnNumber: 0,
- });
- Deno.core.print(`result: ${result}`, true);
- assert(result.fileName.endsWith(".ts"));
- assert(result.lineNumber != null);
- assert(result.columnNumber != null);
-});
diff --git a/runtime/js/40_error_stack.js b/runtime/js/40_error_stack.js
index 1ecf0f6bb..046f4ddf0 100644
--- a/runtime/js/40_error_stack.js
+++ b/runtime/js/40_error_stack.js
@@ -12,13 +12,8 @@
return core.opSync("op_format_file_name", location);
}
- function opApplySourceMap(location) {
- return core.applySourceMap(location);
- }
-
window.__bootstrap.errorStack = {
opFormatDiagnostics,
opFormatFileName,
- opApplySourceMap,
};
})(this);
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index 61e894f8a..a6f63abe2 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -126,7 +126,6 @@
systemMemoryInfo: __bootstrap.os.systemMemoryInfo,
networkInterfaces: __bootstrap.os.networkInterfaces,
getUid: __bootstrap.os.getUid,
- applySourceMap: __bootstrap.errorStack.opApplySourceMap,
formatDiagnostics: __bootstrap.errorStack.opFormatDiagnostics,
sleepSync: __bootstrap.timers.sleepSync,
listen: __bootstrap.netUnstable.listen,