summaryrefslogtreecommitdiff
path: root/cli/js/web/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/web/util.ts')
-rw-r--r--cli/js/web/util.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/js/web/util.ts b/cli/js/web/util.ts
index 53ff8ef22..281048cd8 100644
--- a/cli/js/web/util.ts
+++ b/cli/js/web/util.ts
@@ -208,3 +208,11 @@ export function getHeaderValueParams(value: string): Map<string, string> {
export function hasHeaderValueOf(s: string, value: string): boolean {
return new RegExp(`^${value}[\t\s]*;?`).test(s);
}
+
+/** An internal function which provides a function name for some generated
+ * functions, so stack traces are a bit more readable.
+ *
+ * @internal */
+export function setFunctionName(fn: Function, value: string): void {
+ Object.defineProperty(fn, "name", { value, configurable: true });
+}