mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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 https://chromium-review.googlesource.com/c/v8/v8/+/1352273
This commit is contained in:
@@ -106,7 +106,9 @@ class Dictionary {
|
||||
bool SetMethod(const base::StringPiece& key, const T& callback) {
|
||||
return GetHandle()->Set(
|
||||
StringToV8(isolate_, key),
|
||||
CallbackTraits<T>::CreateTemplate(isolate_, callback)->GetFunction());
|
||||
CallbackTraits<T>::CreateTemplate(isolate_, callback)
|
||||
->GetFunction(isolate_->GetCurrentContext())
|
||||
.ToLocalChecked());
|
||||
}
|
||||
|
||||
bool Delete(const base::StringPiece& key) {
|
||||
|
||||
@@ -39,7 +39,8 @@ void WrappableBase::InitWith(v8::Isolate* isolate,
|
||||
// Call object._init if we have one.
|
||||
v8::Local<v8::Function> init;
|
||||
if (Dictionary(isolate, wrapper).Get("_init", &init))
|
||||
init->Call(wrapper, 0, nullptr);
|
||||
init->Call(isolate->GetCurrentContext(), wrapper, 0, nullptr)
|
||||
.ToLocalChecked();
|
||||
|
||||
AfterInit(isolate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user