Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2020-03-14 14:55:44 +0300
committerBrian White <mscdex@mscdex.net>2020-05-31 00:24:43 +0300
commitc24b74a7abec0848484671771d250cfd961f128e (patch)
tree1e4fec15ee4de3ab4bc483f759322389d71932ec /lib/internal/source_map
parent3f32126fd554be32cb53a2458849697146145fda (diff)
lib: improve debuglog() performance
PR-URL: https://github.com/nodejs/node/pull/32260 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/source_map')
-rw-r--r--lib/internal/source_map/prepare_stack_trace.js4
-rw-r--r--lib/internal/source_map/source_map_cache.js4
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/internal/source_map/prepare_stack_trace.js b/lib/internal/source_map/prepare_stack_trace.js
index df0d79a204b..23e117b677b 100644
--- a/lib/internal/source_map/prepare_stack_trace.js
+++ b/lib/internal/source_map/prepare_stack_trace.js
@@ -4,7 +4,9 @@ const {
Error,
} = primordials;
-const debug = require('internal/util/debuglog').debuglog('source_map');
+let debug = require('internal/util/debuglog').debuglog('source_map', (fn) => {
+ debug = fn;
+});
const { getStringWidth } = require('internal/util/inspect');
const { readFileSync } = require('fs');
const { findSourceMap } = require('internal/source_map/source_map_cache');
diff --git a/lib/internal/source_map/source_map_cache.js b/lib/internal/source_map/source_map_cache.js
index 04926acfc1b..db7a19e2759 100644
--- a/lib/internal/source_map/source_map_cache.js
+++ b/lib/internal/source_map/source_map_cache.js
@@ -22,7 +22,9 @@ function ObjectGetValueSafe(obj, key) {
// See https://sourcemaps.info/spec.html for SourceMap V3 specification.
const { Buffer } = require('buffer');
-const debug = require('internal/util/debuglog').debuglog('source_map');
+let debug = require('internal/util/debuglog').debuglog('source_map', (fn) => {
+ debug = fn;
+});
const { dirname, resolve } = require('path');
const fs = require('fs');
const { getOptionValue } = require('internal/options');