Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup: merge eval_env with env
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
  • Loading branch information
daeyeon committed Jul 8, 2022
commit 06a97fd604d8dfbd74a9b9795287bd5ad5cc4bad
6 changes: 2 additions & 4 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ void ContextifyScript::RunInContext(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsObject() || args[0]->IsNull());

Local<Context> context;
Environment* eval_env = nullptr;
std::shared_ptr<v8::MicrotaskQueue> microtask_queue;

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

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

eval_env = contextify_context->env();
microtask_queue = contextify_context->microtask_queue();
} else {
eval_env = env;
context = env->context();
}

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

// Do the eval within the context
Context::Scope context_scope(context);
EvalMachine(eval_env,
EvalMachine(env,
timeout,
display_errors,
break_on_sigint,
Expand Down