Send document-start/end to the right context when contextIsolation=true (#12738)

This commit is contained in:
Jeremy Apthorp 2018-05-04 23:39:54 -07:00 committed by Shelley Vohr
parent 022b6973b2
commit 118da36b52
3 changed files with 6 additions and 5 deletions

View file

@ -218,8 +218,9 @@ node::Environment* AtomRendererClient::GetEnvironment(
if (injected_frames_.find(render_frame) == injected_frames_.end())
return nullptr;
v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
node::Environment* env = node::Environment::GetCurrent(
render_frame->GetWebFrame()->MainWorldScriptContext());
auto context =
GetContext(render_frame->GetWebFrame(), v8::Isolate::GetCurrent());
node::Environment* env = node::Environment::GetCurrent(context);
if (environments_.find(env) == environments_.end())
return nullptr;
return env;