зеркало из https://github.com/electron/electron.git
fix: confirm a `v8::Value` is a `v8::Object` before casting it (#43575)
fix: confirm a v8::Value is a v8::Object before casting it
This commit is contained in:
Родитель
cc5aa65cb4
Коммит
fe0d4274e2
|
@ -30,12 +30,12 @@ namespace electron {
|
|||
|
||||
namespace {
|
||||
|
||||
bool IsValidWrappable(const v8::Local<v8::Value>& obj) {
|
||||
v8::Local<v8::Object> port = v8::Local<v8::Object>::Cast(obj);
|
||||
|
||||
if (!port->IsObject())
|
||||
bool IsValidWrappable(const v8::Local<v8::Value>& val) {
|
||||
if (!val->IsObject())
|
||||
return false;
|
||||
|
||||
v8::Local<v8::Object> port = val.As<v8::Object>();
|
||||
|
||||
if (port->InternalFieldCount() != gin::kNumberOfInternalFields)
|
||||
return false;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче