From f892c56fa27b2933058f3c341ed6d5bc6ebac1bc Mon Sep 17 00:00:00 2001 From: Brindusan Cristian Date: Thu, 26 Sep 2019 20:11:03 +0300 Subject: [PATCH] Backed out changeset e91773704fbd (bug 1577107) for wpt crashes/assertions on clone-before-keypath-eval.html. CLOSED TREE --HG-- extra : histedit_source : 65f613208b85a94eef3de04365bc8e4e87585ac8 --- dom/indexedDB/IDBObjectStore.cpp | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index d81b6ce65ffe..77c72cdc9188 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -923,9 +923,6 @@ void IDBObjectStore::AppendIndexUpdateInfo( const int64_t aIndexID, const KeyPath& aKeyPath, const bool aMultiEntry, const nsCString& aLocale, JSContext* const aCx, JS::Handle aVal, nsTArray* const aUpdateInfoArray, ErrorResult* const aRv) { - // This precondition holds when `aVal` is the result of a structured clone. - js::AutoAssertNoContentJS noContentJS(aCx); - if (!aMultiEntry) { Key key; *aRv = aKeyPath.ExtractKey(aCx, aVal, key); @@ -951,7 +948,7 @@ void IDBObjectStore::AppendIndexUpdateInfo( } bool isArray; - if (NS_WARN_IF(!JS_IsArrayObject(aCx, val, &isArray))) { + if (!JS_IsArrayObject(aCx, val, &isArray)) { IDB_REPORT_INTERNAL_ERR(); aRv->Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR); return; @@ -966,27 +963,8 @@ void IDBObjectStore::AppendIndexUpdateInfo( } for (uint32_t arrayIndex = 0; arrayIndex < arrayLength; arrayIndex++) { - JS::RootedId indexId(aCx); - if (NS_WARN_IF(!JS_IndexToId(aCx, arrayIndex, &indexId))) { - 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))) { + JS::Rooted arrayItem(aCx); + if (NS_WARN_IF(!JS_GetElement(aCx, array, arrayIndex, &arrayItem))) { IDB_REPORT_INTERNAL_ERR(); aRv->Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR); return; @@ -1441,8 +1419,6 @@ void IDBObjectStore::GetAddInfo(JSContext* aCx, ValueWrapper& aValueWrapper, return; } - js::AutoAssertNoContentJS noContentJS(aCx); - { const nsTArray& indexes = mSpec->indexes(); uint32_t idxCount = indexes.Length();