migrate to non-deprecated v8 functions
https://bugs.chromium.org/p/v8/issues/detail?id=8238
https://bugs.chromium.org/p/v8/issues/detail?id=7295
1352273
This commit is contained in:
parent
7d5cd2051a
commit
d01db5a656
26 changed files with 94 additions and 46 deletions
|
@ -211,10 +211,11 @@ void SpellCheckClient::SpellCheckWords(
|
|||
v8::Local<v8::FunctionTemplate> templ = mate::CreateFunctionTemplate(
|
||||
isolate_, base::Bind(&SpellCheckClient::OnSpellCheckDone, AsWeakPtr()));
|
||||
|
||||
auto context = isolate_->GetCurrentContext();
|
||||
v8::Local<v8::Value> args[] = {mate::ConvertToV8(isolate_, words),
|
||||
templ->GetFunction()};
|
||||
templ->GetFunction(context).ToLocalChecked()};
|
||||
// Call javascript with the words and the callback function
|
||||
scope.spell_check_->Call(scope.provider_, 2, args);
|
||||
scope.spell_check_->Call(context, scope.provider_, 2, args).ToLocalChecked();
|
||||
}
|
||||
|
||||
// Returns whether or not the given string is a contraction.
|
||||
|
|
|
@ -222,7 +222,9 @@ int WebFrame::GetWebFrameId(v8::Local<v8::Value> content_window) {
|
|||
void WebFrame::SetSpellCheckProvider(mate::Arguments* args,
|
||||
const std::string& language,
|
||||
v8::Local<v8::Object> provider) {
|
||||
if (!provider->Has(mate::StringToV8(args->isolate(), "spellCheck"))) {
|
||||
auto context = args->isolate()->GetCurrentContext();
|
||||
if (!provider->Has(context, mate::StringToV8(args->isolate(), "spellCheck"))
|
||||
.ToChecked()) {
|
||||
args->ThrowError("\"spellCheck\" has to be defined");
|
||||
return;
|
||||
}
|
||||
|
@ -541,7 +543,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
mate::Dictionary dict(isolate, exports);
|
||||
dict.Set("webFrame", WebFrame::Create(isolate));
|
||||
dict.Set("WebFrame", WebFrame::GetConstructor(isolate)->GetFunction());
|
||||
dict.Set(
|
||||
"WebFrame",
|
||||
WebFrame::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue