diff options
author | Gus Caplan <me@gus.host> | 2018-02-26 14:29:41 -0600 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2018-03-12 14:39:21 -0500 |
commit | cb5f358ee7461f191db8c88e0af26023558f5232 (patch) | |
tree | f23e34d68a09fb05d044f00bd795575db63a9370 /src/node_context_data.h | |
parent | a03c90b661f69200f124718b56b55b0cb3506c71 (diff) | |
download | android-node-v8-cb5f358ee7461f191db8c88e0af26023558f5232.tar.gz android-node-v8-cb5f358ee7461f191db8c88e0af26023558f5232.tar.bz2 android-node-v8-cb5f358ee7461f191db8c88e0af26023558f5232.zip |
vm: add code generation options
Adds options to a VM Context to disable code generation from strings
(such as eval or new Function) and WASM code generation
(WebAssembly.compile).
PR-URL: https://github.com/nodejs/node/pull/19016
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@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 9d3145bb80..522ce292d2 100644 --- a/src/node_context_data.h +++ b/src/node_context_data.h @@ -15,9 +15,14 @@ namespace node { #define NODE_CONTEXT_SANDBOX_OBJECT_INDEX 33 #endif +#ifndef NODE_CONTEXT_ALLOW_WASM_CODE_GENERATION_INDEX +#define NODE_CONTEXT_ALLOW_WASM_CODE_GENERATION_INDEX 34 +#endif + enum ContextEmbedderIndex { kEnvironment = NODE_CONTEXT_EMBEDDER_DATA_INDEX, kSandboxObject = NODE_CONTEXT_SANDBOX_OBJECT_INDEX, + kAllowWasmCodeGeneration = NODE_CONTEXT_ALLOW_WASM_CODE_GENERATION_INDEX, }; } // namespace node |