diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-09-12 15:01:50 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-09-17 17:20:27 +0200 |
commit | 4286dcf17f062034117043a2640b620210b61f57 (patch) | |
tree | de227e8bb7bee72778a2e7bd98f08991839bf866 /src/node_context_data.h | |
parent | c33e27dc3caf5a5b7954706fe6ecde1e4f82534d (diff) | |
download | android-node-v8-4286dcf17f062034117043a2640b620210b61f57.tar.gz android-node-v8-4286dcf17f062034117043a2640b620210b61f57.tar.bz2 android-node-v8-4286dcf17f062034117043a2640b620210b61f57.zip |
src: refactor `Environment::GetCurrent()` usage
Make `Environment::GetCurrent()` return `nullptr` if the current
`Context` is not a Node.js context, and for the relevant usage of
this function, either:
- Switch to the better `GetCurrent(args)` variant
- Turn functions in to no-ops where it makes sense
- Make it a `CHECK`, i.e. an API requirement, where it make sense
- Leave a `TODO` comment for verifying what, if anything, is to be done
PR-URL: https://github.com/nodejs/node/pull/22819
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/node_context_data.h')
-rw-r--r-- | src/node_context_data.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/node_context_data.h b/src/node_context_data.h index 61ab81523c..807ba56c7c 100644 --- a/src/node_context_data.h +++ b/src/node_context_data.h @@ -25,16 +25,11 @@ namespace node { #define NODE_CONTEXT_TAG 35 #endif -#ifndef NODE_CONTEXT_TAG_BOUNDARY -#define NODE_CONTEXT_TAG_BOUNDARY 36 -#endif - enum ContextEmbedderIndex { kEnvironment = NODE_CONTEXT_EMBEDDER_DATA_INDEX, kSandboxObject = NODE_CONTEXT_SANDBOX_OBJECT_INDEX, kAllowWasmCodeGeneration = NODE_CONTEXT_ALLOW_WASM_CODE_GENERATION_INDEX, kContextTag = NODE_CONTEXT_TAG, - kContextTagBoundary = NODE_CONTEXT_TAG_BOUNDARY, }; } // namespace node |