diff options
Diffstat (limited to 'lib/internal/util.js')
-rw-r--r-- | lib/internal/util.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/internal/util.js b/lib/internal/util.js index 9ecdf17ecd..a0c2412dce 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -3,6 +3,9 @@ const binding = process.binding('util'); const prefix = `(${process.release.name}:${process.pid}) `; +const kArrowMessagePrivateSymbolIndex = binding['arrow_message_private_symbol']; +const kDecoratedPrivateSymbolIndex = binding['decorated_private_symbol']; + exports.getHiddenValue = binding.getHiddenValue; exports.setHiddenValue = binding.setHiddenValue; @@ -65,14 +68,14 @@ exports._deprecate = function(fn, msg) { exports.decorateErrorStack = function decorateErrorStack(err) { if (!(exports.isError(err) && err.stack) || - exports.getHiddenValue(err, 'node:decorated') === true) + exports.getHiddenValue(err, kDecoratedPrivateSymbolIndex) === true) return; - const arrow = exports.getHiddenValue(err, 'node:arrowMessage'); + const arrow = exports.getHiddenValue(err, kArrowMessagePrivateSymbolIndex); if (arrow) { err.stack = arrow + err.stack; - exports.setHiddenValue(err, 'node:decorated', true); + exports.setHiddenValue(err, kDecoratedPrivateSymbolIndex, true); } }; |