From 75ca013f076f443dce3d38f31a168295351ed0e5 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Sat, 18 Sep 2021 14:40:04 +0100 Subject: fix(cli/fmt_errors): Abbreviate long data URLs in stack traces (#12127) Co-authored-by: Mike White --- runtime/js/99_main.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'runtime/js/99_main.js') diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 5c1c04766..b16fabe8a 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -218,17 +218,13 @@ delete Object.prototype.__proto__; ); build.setBuildInfo(runtimeOptions.target); util.setLogDebug(runtimeOptions.debugFlag, source); - // TODO(bartlomieju): a very crude way to disable - // source mapping of errors. This condition is true - // only for compiled standalone binaries. - let prepareStackTrace; - if (runtimeOptions.applySourceMaps) { - prepareStackTrace = core.createPrepareStackTrace( - errorStack.opApplySourceMap, - ); - } else { - prepareStackTrace = core.createPrepareStackTrace(); - } + const prepareStackTrace = core.createPrepareStackTrace( + // TODO(bartlomieju): a very crude way to disable + // source mapping of errors. This condition is true + // only for compiled standalone binaries. + runtimeOptions.applySourceMaps ? errorStack.opApplySourceMap : undefined, + errorStack.opFormatFileName, + ); // deno-lint-ignore prefer-primordials Error.prepareStackTrace = prepareStackTrace; } -- cgit v1.2.3