summaryrefslogtreecommitdiff
path: root/src/node_contextify.h
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2018-03-04 14:59:51 -0600
committerGus Caplan <me@gus.host>2018-03-07 12:19:38 -0600
commitc9b4de55c061ecb8d64cda9e36821c21f8150925 (patch)
tree51813a516bb2ac257ff51d8b1a9059a30bc07013 /src/node_contextify.h
parenta6c14b2f4259a9ca080a7b486dc934e4ccef8938 (diff)
downloadandroid-node-v8-c9b4de55c061ecb8d64cda9e36821c21f8150925.tar.gz
android-node-v8-c9b4de55c061ecb8d64cda9e36821c21f8150925.tar.bz2
android-node-v8-c9b4de55c061ecb8d64cda9e36821c21f8150925.zip
src: standardise context embedder indices
PR-URL: https://github.com/nodejs/node/pull/19135 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com>
Diffstat (limited to 'src/node_contextify.h')
-rw-r--r--src/node_contextify.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/node_contextify.h b/src/node_contextify.h
index 9f83740e43..b25e1a75d4 100644
--- a/src/node_contextify.h
+++ b/src/node_contextify.h
@@ -4,16 +4,13 @@
#include "node_internals.h"
#include "node_watchdog.h"
#include "base_object-inl.h"
+#include "node_context_data.h"
namespace node {
namespace contextify {
class ContextifyContext {
protected:
- // V8 reserves the first field in context objects for the debugger. We use the
- // second field to hold a reference to the sandbox object.
- enum { kSandboxObjectIndex = 1 };
-
Environment* const env_;
Persistent<v8::Context> context_;
@@ -45,7 +42,7 @@ class ContextifyContext {
inline v8::Local<v8::Object> sandbox() const {
return v8::Local<v8::Object>::Cast(
- context()->GetEmbedderData(kSandboxObjectIndex));
+ context()->GetEmbedderData(ContextEmbedderIndex::kSandboxObject));
}
private: