Skip to content

Commit 78766fc

Browse files
committed
setup vm context for DOM access
NWJS#4018
1 parent a33ec15 commit 78766fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/node_contextify.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ class ContextifyContext {
222222
// directly in an Object, we instead hold onto the new context's global
223223
// object instead (which then has a reference to the context).
224224
ctx->SetEmbedderData(kSandboxObjectIndex, sandbox_obj);
225+
void* data = env->context()->GetAlignedPointerFromEmbedderData(2); //v8ContextPerContextDataIndex
226+
ctx->SetAlignedPointerInEmbedderData(2, data);
227+
ctx->SetAlignedPointerInEmbedderData(33, (void*)0x08110800);
225228
sandbox_obj->SetPrivate(env->context(),
226229
env->contextify_global_private_symbol(),
227230
ctx->Global());

0 commit comments

Comments
 (0)