summaryrefslogtreecommitdiff
path: root/cli/js/error_stack.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/error_stack.ts')
-rw-r--r--cli/js/error_stack.ts21
1 files changed, 10 insertions, 11 deletions
diff --git a/cli/js/error_stack.ts b/cli/js/error_stack.ts
index 39561ad85..4c46675ca 100644
--- a/cli/js/error_stack.ts
+++ b/cli/js/error_stack.ts
@@ -1,4 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+
// Some of the code here is adapted directly from V8 and licensed under a BSD
// style license available here: https://github.com/v8/v8/blob/24886f2d1c565287d33d71e4109a53bf0b54b75c/LICENSE.v8
import * as colors from "./colors.ts";
@@ -94,10 +95,10 @@ function getMethodCall(callSite: CallSite): string {
return result;
}
-function getFileLocation(callSite: CallSite, isInternal = false): string {
- const cyan = isInternal ? colors.gray : colors.cyan;
- const yellow = isInternal ? colors.gray : colors.yellow;
- const black = isInternal ? colors.gray : (s: string): string => s;
+function getFileLocation(callSite: CallSite, internal = false): string {
+ const cyan = internal ? colors.gray : colors.cyan;
+ const yellow = internal ? colors.gray : colors.yellow;
+ const black = internal ? colors.gray : (s: string): string => s;
if (callSite.isNative()) {
return cyan("native");
}
@@ -130,9 +131,9 @@ function getFileLocation(callSite: CallSite, isInternal = false): string {
return result;
}
-function callSiteToString(callSite: CallSite, isInternal = false): string {
- const cyan = isInternal ? colors.gray : colors.cyan;
- const black = isInternal ? colors.gray : (s: string): string => s;
+function callSiteToString(callSite: CallSite, internal = false): string {
+ const cyan = internal ? colors.gray : colors.cyan;
+ const black = internal ? colors.gray : (s: string): string => s;
let result = "";
const functionName = callSite.getFunctionName();
@@ -164,13 +165,11 @@ function callSiteToString(callSite: CallSite, isInternal = false): string {
} else if (functionName) {
result += colors.bold(colors.italic(black(functionName)));
} else {
- result += getFileLocation(callSite, isInternal);
+ result += getFileLocation(callSite, internal);
return result;
}
- result += ` ${black("(")}${getFileLocation(callSite, isInternal)}${black(
- ")"
- )}`;
+ result += ` ${black("(")}${getFileLocation(callSite, internal)}${black(")")}`;
return result;
}