diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2016-05-31 19:58:31 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2016-06-01 09:29:49 +0200 |
commit | 334ef4f19dc0bbdf9a9fde9f4a6e7042a6c6e2a3 (patch) | |
tree | 971e0c8186631f180ac87878eda73ec68991e51d /lib/internal/util.js | |
parent | c3cd453cbae84ff6d639a2b8d7776a15b3e3431b (diff) | |
download | android-node-v8-334ef4f19dc0bbdf9a9fde9f4a6e7042a6c6e2a3.tar.gz android-node-v8-334ef4f19dc0bbdf9a9fde9f4a6e7042a6c6e2a3.tar.bz2 android-node-v8-334ef4f19dc0bbdf9a9fde9f4a6e7042a6c6e2a3.zip |
lib,src: drop dependency on v8::Private::ForApi()
Said function requires that a v8::Context has been entered first,
introducing a chicken-and-egg problem when creating the first context.
PR-URL: https://github.com/nodejs/node/pull/7082
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
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); } }; |