Skip to content

Commit 6d86ee6

Browse files
committed
fixup: merge eval_env with env
Signed-off-by: Daeyeon Jeong [email protected]
1 parent d0d2e0d commit 6d86ee6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/node_contextify.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,6 @@ void ContextifyScript::RunInContext(const FunctionCallbackInfo<Value>& args) {
852852
CHECK(args[0]->IsObject() || args[0]->IsNull());
853853

854854
Local<Context> context;
855-
Environment* eval_env = nullptr;
856855
std::shared_ptr<v8::MicrotaskQueue> microtask_queue;
857856

858857
if (args[0]->IsObject()) {
@@ -861,14 +860,13 @@ void ContextifyScript::RunInContext(const FunctionCallbackInfo<Value>& args) {
861860
ContextifyContext* contextify_context =
862861
ContextifyContext::ContextFromContextifiedSandbox(env, sandbox);
863862
CHECK_NOT_NULL(contextify_context);
863+
CHECK_EQ(contextify_context->env(), env);
864864

865865
context = contextify_context->context();
866866
if (context.IsEmpty()) return;
867867

868-
eval_env = contextify_context->env();
869868
microtask_queue = contextify_context->microtask_queue();
870869
} else {
871-
eval_env = env;
872870
context = env->context();
873871
}
874872

@@ -888,7 +886,7 @@ void ContextifyScript::RunInContext(const FunctionCallbackInfo<Value>& args) {
888886

889887
// Do the eval within the context
890888
Context::Scope context_scope(context);
891-
EvalMachine(eval_env,
889+
EvalMachine(env,
892890
timeout,
893891
display_errors,
894892
break_on_sigint,

0 commit comments

Comments
 (0)