fix: update to per context v8::Script::Compile api
This commit is contained in:
parent
c1f32afeeb
commit
66349261a5
5 changed files with 40 additions and 30 deletions
|
@ -278,4 +278,13 @@ v8::Local<v8::Context> RendererClientBase::GetContext(
|
|||
return frame->MainWorldScriptContext();
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> RunScript(v8::Local<v8::Context> context,
|
||||
v8::Local<v8::String> source) {
|
||||
auto maybe_script = v8::Script::Compile(context, source);
|
||||
v8::Local<v8::Script> script;
|
||||
if (!maybe_script.ToLocal(&script))
|
||||
return v8::Local<v8::Value>();
|
||||
return script->Run(context).ToLocalChecked();
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue