chore: fix V8 deprecation warnings (#15842)
This commit is contained in:
parent
455f0669e7
commit
81e00d8e56
9 changed files with 32 additions and 22 deletions
|
@ -198,10 +198,11 @@ void AtomRendererClient::SetupMainWorldOverrides(
|
|||
// an argument.
|
||||
std::string left = "(function (binding, require) {\n";
|
||||
std::string right = "\n})";
|
||||
auto script = v8::Script::Compile(v8::String::Concat(
|
||||
auto source = v8::String::Concat(
|
||||
mate::ConvertToV8(isolate, left)->ToString(),
|
||||
v8::String::Concat(node::isolated_bundle_value.ToStringChecked(isolate),
|
||||
mate::ConvertToV8(isolate, right)->ToString())));
|
||||
mate::ConvertToV8(isolate, right)->ToString()));
|
||||
auto script = v8::Script::Compile(context, source).ToLocalChecked();
|
||||
auto func =
|
||||
v8::Handle<v8::Function>::Cast(script->Run(context).ToLocalChecked());
|
||||
|
||||
|
|
|
@ -87,8 +87,9 @@ v8::Local<v8::Value> GetBinding(v8::Isolate* isolate,
|
|||
|
||||
v8::Local<v8::Value> CreatePreloadScript(v8::Isolate* isolate,
|
||||
v8::Local<v8::String> preloadSrc) {
|
||||
auto script = v8::Script::Compile(preloadSrc);
|
||||
auto func = script->Run();
|
||||
auto context = isolate->GetCurrentContext();
|
||||
auto script = v8::Script::Compile(context, preloadSrc).ToLocalChecked();
|
||||
auto func = script->Run(context).ToLocalChecked();
|
||||
return func;
|
||||
}
|
||||
|
||||
|
@ -206,10 +207,11 @@ void AtomSandboxedRendererClient::DidCreateScriptContext(
|
|||
std::string left = "(function(binding, require) {\n";
|
||||
std::string right = "\n})";
|
||||
// Compile the wrapper and run it to get the function object
|
||||
auto script = v8::Script::Compile(v8::String::Concat(
|
||||
auto source = v8::String::Concat(
|
||||
mate::ConvertToV8(isolate, left)->ToString(),
|
||||
v8::String::Concat(node::preload_bundle_value.ToStringChecked(isolate),
|
||||
mate::ConvertToV8(isolate, right)->ToString())));
|
||||
mate::ConvertToV8(isolate, right)->ToString()));
|
||||
auto script = v8::Script::Compile(context, source).ToLocalChecked();
|
||||
auto func =
|
||||
v8::Handle<v8::Function>::Cast(script->Run(context).ToLocalChecked());
|
||||
// Create and initialize the binding object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue