Allow same object to appear in one list when parsing V8 array

Fixes #874.
This commit is contained in:
Cheng Zhao 2014-12-16 16:57:42 -08:00
parent 95dd73bd1d
commit 4fc14959a8
2 changed files with 12 additions and 1 deletions

View file

@ -294,7 +294,10 @@ base::Value* V8ValueConverter::FromV8Array(
if (!val->HasRealIndexedProperty(i))
continue;
base::Value* child = FromV8ValueImpl(state, child_v8, isolate);
// When parsing elements in an array, we use a new state so we can have the
// same object showed twice in array.
FromV8ValueState new_state;
base::Value* child = FromV8ValueImpl(&new_state, child_v8, isolate);
if (child)
result->Append(child);
else