7
7
#include " Key.h"
8
8
9
9
#include < algorithm>
10
- #include < stdint.h> // for UINT32_MAX, uintptr_t
10
+ #include < stdint.h> // for UINT32_MAX, uintptr_t
11
11
#include " js/Array.h" // JS::NewArrayObject
12
12
#include " js/ArrayBuffer.h" // JS::{IsArrayBufferObject,NewArrayBuffer{,WithContents},GetArrayBufferLengthAndData}
13
13
#include " js/Date.h"
@@ -41,7 +41,7 @@ namespace {
41
41
// https://w3c.github.io/IndexedDB/#convert-value-to-key
42
42
template <typename ArrayConversionPolicy>
43
43
IDBResult<Ok, IDBSpecialValue::Invalid> ConvertArrayValueToKey (
44
- JSContext* const aCx, JS::HandleObject aObject,
44
+ JSContext* const aCx, JS::Handle <JSObject*> aObject,
45
45
ArrayConversionPolicy&& aPolicy) {
46
46
// 1. Let `len` be ? ToLength( ? Get(`input`, "length")).
47
47
uint32_t len;
@@ -60,7 +60,7 @@ IDBResult<Ok, IDBSpecialValue::Invalid> ConvertArrayValueToKey(
60
60
61
61
// 5. While `index` is less than `len`:
62
62
while (index < len) {
63
- JS::RootedId indexId (aCx);
63
+ JS::Rooted<JS::PropertyKey> indexId (aCx);
64
64
if (!JS_IndexToId (aCx, index , &indexId)) {
65
65
return Err (IDBException (NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR));
66
66
}
@@ -77,7 +77,7 @@ IDBResult<Ok, IDBSpecialValue::Invalid> ConvertArrayValueToKey(
77
77
}
78
78
79
79
// 3. Let `entry` be ? Get(`input`, `index`).
80
- JS::RootedValue entry (aCx);
80
+ JS::Rooted<JS::Value> entry (aCx);
81
81
if (!JS_GetPropertyById (aCx, aObject, indexId, &entry)) {
82
82
return Err (IDBException (NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR));
83
83
}
@@ -330,7 +330,7 @@ class MOZ_STACK_CLASS Key::ArrayValueEncoder final {
330
330
mTypeOffset (aTypeOffset),
331
331
mRecursionDepth(aRecursionDepth) {}
332
332
333
- void AddToSeenSet (JSContext* const aCx, JS::HandleObject ) {
333
+ void AddToSeenSet (JSContext* const aCx, JS::Handle <JSObject*> ) {
334
334
++mRecursionDepth ;
335
335
}
336
336
@@ -345,9 +345,9 @@ class MOZ_STACK_CLASS Key::ArrayValueEncoder final {
345
345
MOZ_ASSERT (mTypeOffset < eMaxType * kMaxArrayCollapse );
346
346
}
347
347
348
- IDBResult<Ok, IDBSpecialValue::Invalid> ConvertSubkey (JSContext* const aCx,
349
- JS::HandleValue aEntry,
350
- const uint32_t aIndex) {
348
+ IDBResult<Ok, IDBSpecialValue::Invalid> ConvertSubkey (
349
+ JSContext* const aCx, JS::Handle <JS::Value> aEntry,
350
+ const uint32_t aIndex) {
351
351
auto result =
352
352
mKey .EncodeJSValInternal (aCx, aEntry, mTypeOffset , mRecursionDepth );
353
353
mTypeOffset = 0 ;
@@ -406,7 +406,7 @@ IDBResult<Ok, IDBSpecialValue::Invalid> Key::EncodeJSValInternal(
406
406
}
407
407
408
408
if (aVal.isObject ()) {
409
- JS::RootedObject object (aCx, &aVal.toObject ());
409
+ JS::Rooted<JSObject*> object (aCx, &aVal.toObject ());
410
410
411
411
js::ESClass builtinClass;
412
412
if (!JS::GetBuiltinClass (aCx, object, &builtinClass)) {
@@ -845,7 +845,7 @@ Result<Ok, nsresult> Key::EncodeBinary(JSObject* aObject, bool aIsViewObject,
845
845
// static
846
846
JSObject* Key::DecodeBinary (const EncodedDataType*& aPos,
847
847
const EncodedDataType* aEnd, JSContext* aCx) {
848
- JS::RootedObject rv (aCx);
848
+ JS::Rooted<JSObject*> rv (aCx);
849
849
DecodeStringy<eBinary, uint8_t >(
850
850
aPos, aEnd,
851
851
[&rv, aCx](uint8_t ** out, uint32_t decodedSize) {
0 commit comments