refactor: replace v8::Local<T>::Cast() with As<T>() (#29097)
This commit is contained in:
parent
e01faedaa5
commit
a51aaeb28f
13 changed files with 31 additions and 34 deletions
|
@ -86,7 +86,7 @@ class RefCountedGlobal
|
|||
: public base::RefCountedThreadSafe<RefCountedGlobal<T>, DeleteOnUIThread> {
|
||||
public:
|
||||
RefCountedGlobal(v8::Isolate* isolate, v8::Local<v8::Value> value)
|
||||
: handle_(isolate, v8::Local<T>::Cast(value)) {}
|
||||
: handle_(isolate, value.As<T>()) {}
|
||||
|
||||
bool IsAlive() const { return !handle_.IsEmpty(); }
|
||||
|
||||
|
@ -147,8 +147,7 @@ v8::Local<v8::Value> BindFunctionWith(v8::Isolate* isolate,
|
|||
v8::MaybeLocal<v8::Value> bind =
|
||||
func->Get(context, gin::StringToV8(isolate, "bind"));
|
||||
CHECK(!bind.IsEmpty());
|
||||
v8::Local<v8::Function> bind_func =
|
||||
v8::Local<v8::Function>::Cast(bind.ToLocalChecked());
|
||||
v8::Local<v8::Function> bind_func = bind.ToLocalChecked().As<v8::Function>();
|
||||
v8::Local<v8::Value> converted[] = {func, arg1, arg2};
|
||||
return bind_func->Call(context, func, base::size(converted), converted)
|
||||
.ToLocalChecked();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue