зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset e91773704fbd (bug 1577107) for wpt crashes/assertions on clone-before-keypath-eval.html. CLOSED TREE
--HG-- extra : histedit_source : 65f613208b85a94eef3de04365bc8e4e87585ac8
This commit is contained in:
Родитель
d2d88e021d
Коммит
f892c56fa2
|
@ -923,9 +923,6 @@ void IDBObjectStore::AppendIndexUpdateInfo(
|
||||||
const int64_t aIndexID, const KeyPath& aKeyPath, const bool aMultiEntry,
|
const int64_t aIndexID, const KeyPath& aKeyPath, const bool aMultiEntry,
|
||||||
const nsCString& aLocale, JSContext* const aCx, JS::Handle<JS::Value> aVal,
|
const nsCString& aLocale, JSContext* const aCx, JS::Handle<JS::Value> aVal,
|
||||||
nsTArray<IndexUpdateInfo>* const aUpdateInfoArray, ErrorResult* const aRv) {
|
nsTArray<IndexUpdateInfo>* const aUpdateInfoArray, ErrorResult* const aRv) {
|
||||||
// This precondition holds when `aVal` is the result of a structured clone.
|
|
||||||
js::AutoAssertNoContentJS noContentJS(aCx);
|
|
||||||
|
|
||||||
if (!aMultiEntry) {
|
if (!aMultiEntry) {
|
||||||
Key key;
|
Key key;
|
||||||
*aRv = aKeyPath.ExtractKey(aCx, aVal, key);
|
*aRv = aKeyPath.ExtractKey(aCx, aVal, key);
|
||||||
|
@ -951,7 +948,7 @@ void IDBObjectStore::AppendIndexUpdateInfo(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isArray;
|
bool isArray;
|
||||||
if (NS_WARN_IF(!JS_IsArrayObject(aCx, val, &isArray))) {
|
if (!JS_IsArrayObject(aCx, val, &isArray)) {
|
||||||
IDB_REPORT_INTERNAL_ERR();
|
IDB_REPORT_INTERNAL_ERR();
|
||||||
aRv->Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
aRv->Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||||
return;
|
return;
|
||||||
|
@ -966,27 +963,8 @@ void IDBObjectStore::AppendIndexUpdateInfo(
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t arrayIndex = 0; arrayIndex < arrayLength; arrayIndex++) {
|
for (uint32_t arrayIndex = 0; arrayIndex < arrayLength; arrayIndex++) {
|
||||||
JS::RootedId indexId(aCx);
|
JS::Rooted<JS::Value> arrayItem(aCx);
|
||||||
if (NS_WARN_IF(!JS_IndexToId(aCx, arrayIndex, &indexId))) {
|
if (NS_WARN_IF(!JS_GetElement(aCx, array, arrayIndex, &arrayItem))) {
|
||||||
IDB_REPORT_INTERNAL_ERR();
|
|
||||||
aRv->Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasOwnProperty;
|
|
||||||
if (NS_WARN_IF(
|
|
||||||
!JS_HasOwnPropertyById(aCx, array, indexId, &hasOwnProperty))) {
|
|
||||||
IDB_REPORT_INTERNAL_ERR();
|
|
||||||
aRv->Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hasOwnProperty) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS::RootedValue arrayItem(aCx);
|
|
||||||
if (NS_WARN_IF(!JS_GetPropertyById(aCx, array, indexId, &arrayItem))) {
|
|
||||||
IDB_REPORT_INTERNAL_ERR();
|
IDB_REPORT_INTERNAL_ERR();
|
||||||
aRv->Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
aRv->Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||||
return;
|
return;
|
||||||
|
@ -1441,8 +1419,6 @@ void IDBObjectStore::GetAddInfo(JSContext* aCx, ValueWrapper& aValueWrapper,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
js::AutoAssertNoContentJS noContentJS(aCx);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const nsTArray<IndexMetadata>& indexes = mSpec->indexes();
|
const nsTArray<IndexMetadata>& indexes = mSpec->indexes();
|
||||||
uint32_t idxCount = indexes.Length();
|
uint32_t idxCount = indexes.Length();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче