diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2020-04-19 22:51:05 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-05-06 07:44:04 +0300 |
commit | 86fdaa745572a3bec4370ac7bd05d18e6bf64c01 (patch) | |
tree | 45890dbc713ad29edd830fd2aa17f592909ccbb7 /src/node_context_data.h | |
parent | f446b2058dcfaf9d4e2f6bdfe555bc4437f41acf (diff) |
src: retrieve binding data from the context
Instead of passing them through the data bound to function
templates, store references to them in a list embedded inside
the context.
This makes the function templates more context-independent,
and makes it possible to embed binding data in non-main contexts.
Co-authored-by: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/33139
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/node_context_data.h')
-rw-r--r-- | src/node_context_data.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node_context_data.h b/src/node_context_data.h index 807ba56c7c6..912e65b4270 100644 --- a/src/node_context_data.h +++ b/src/node_context_data.h @@ -25,11 +25,16 @@ namespace node { #define NODE_CONTEXT_TAG 35 #endif +#ifndef NODE_BINDING_LIST +#define NODE_BINDING_LIST_INDEX 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, + kBindingListIndex = NODE_BINDING_LIST_INDEX }; } // namespace node |