Move IsExternal check to FromV8ValueImpl

This commit is contained in:
Kevin Sawicki 2016-08-30 08:51:22 -07:00
parent 679ee95e8a
commit 8a9776b227

View file

@ -262,6 +262,9 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
if (state->HasReachedMaxRecursionDepth())
return nullptr;
if (val->IsExternal())
return base::Value::CreateNullValue().release();
if (val->IsNull())
return base::Value::CreateNullValue().release();
@ -415,11 +418,6 @@ base::Value* V8ValueConverter::FromV8Object(
child_v8 = v8::Null(isolate);
}
// Ignore external values since calling CreationContext() on them can
// crash
if (child_v8->IsExternal())
continue;
std::unique_ptr<base::Value> child(
FromV8ValueImpl(state, child_v8, isolate));
if (!child.get())