зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1754405 part 5 - Remove INT_FITS_IN_JSID/INT_TO_JSID. r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D138276
This commit is contained in:
Родитель
fd4c2058d1
Коммит
e508008806
|
@ -141,7 +141,7 @@ bool AppendIndexedPropertyNames(JSContext* aCx, BrowsingContext* aContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < length; ++i) {
|
for (int32_t i = 0; i < length; ++i) {
|
||||||
aIndexedProps.infallibleAppend(INT_TO_JSID(i));
|
aIndexedProps.infallibleAppend(JS::PropertyKey::Int(i));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1081,7 +1081,7 @@ bool nsOuterWindowProxy::AppendIndexedPropertyNames(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (int32_t i = 0; i < int32_t(length); ++i) {
|
for (int32_t i = 0; i < int32_t(length); ++i) {
|
||||||
if (!props.append(INT_TO_JSID(i))) {
|
if (!props.append(JS::PropertyKey::Int(i))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15064,7 +15064,7 @@ class CGDOMJSProxyHandler_ownPropNames(ClassMethod):
|
||||||
uint32_t length = UnwrapProxy(proxy)->Length(${callerType});
|
uint32_t length = UnwrapProxy(proxy)->Length(${callerType});
|
||||||
MOZ_ASSERT(int32_t(length) >= 0);
|
MOZ_ASSERT(int32_t(length) >= 0);
|
||||||
for (int32_t i = 0; i < int32_t(length); ++i) {
|
for (int32_t i = 0; i < int32_t(length); ++i) {
|
||||||
if (!props.append(INT_TO_JSID(i))) {
|
if (!props.append(JS::PropertyKey::Int(i))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,14 @@ struct PropertyKey {
|
||||||
|
|
||||||
bool isWellKnownSymbol(JS::SymbolCode code) const;
|
bool isWellKnownSymbol(JS::SymbolCode code) const;
|
||||||
|
|
||||||
|
static constexpr bool fitsInInt(int32_t i) { return i >= 0; }
|
||||||
|
|
||||||
|
static constexpr PropertyKey Int(int32_t i) {
|
||||||
|
MOZ_ASSERT(fitsInInt(i));
|
||||||
|
uint32_t bits = (static_cast<uint32_t>(i) << 1) | JSID_TYPE_INT_BIT;
|
||||||
|
return PropertyKey::fromRawBits(bits);
|
||||||
|
}
|
||||||
|
|
||||||
// This API can be used by embedders to convert pinned (aka interned) strings,
|
// This API can be used by embedders to convert pinned (aka interned) strings,
|
||||||
// as created by JS_AtomizeAndPinString, into PropertyKeys. This means the
|
// as created by JS_AtomizeAndPinString, into PropertyKeys. This means the
|
||||||
// string does not have to be explicitly rooted.
|
// string does not have to be explicitly rooted.
|
||||||
|
@ -189,16 +197,6 @@ using jsid = JS::PropertyKey;
|
||||||
#define JSID_INT_MIN 0
|
#define JSID_INT_MIN 0
|
||||||
#define JSID_INT_MAX INT32_MAX
|
#define JSID_INT_MAX INT32_MAX
|
||||||
|
|
||||||
static MOZ_ALWAYS_INLINE bool INT_FITS_IN_JSID(int32_t i) { return i >= 0; }
|
|
||||||
|
|
||||||
static MOZ_ALWAYS_INLINE jsid INT_TO_JSID(int32_t i) {
|
|
||||||
jsid id;
|
|
||||||
MOZ_ASSERT(INT_FITS_IN_JSID(i));
|
|
||||||
uint32_t bits = (static_cast<uint32_t>(i) << 1) | JSID_TYPE_INT_BIT;
|
|
||||||
JSID_BITS(id) = static_cast<size_t>(bits);
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
static MOZ_ALWAYS_INLINE jsid SYMBOL_TO_JSID(JS::Symbol* sym) {
|
static MOZ_ALWAYS_INLINE jsid SYMBOL_TO_JSID(JS::Symbol* sym) {
|
||||||
jsid id;
|
jsid id;
|
||||||
MOZ_ASSERT(sym != nullptr);
|
MOZ_ASSERT(sym != nullptr);
|
||||||
|
|
|
@ -894,7 +894,7 @@ static inline bool ObjectMayHaveExtraIndexedOwnProperties(JSObject* obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return ClassMayResolveId(*obj->runtimeFromAnyThread()->commonNames,
|
return ClassMayResolveId(*obj->runtimeFromAnyThread()->commonNames,
|
||||||
obj->getClass(), INT_TO_JSID(0), obj);
|
obj->getClass(), PropertyKey::Int(0), obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1529,7 +1529,7 @@ static DenseElementResult ArrayReverseDenseKernel(JSContext* cx,
|
||||||
}
|
}
|
||||||
|
|
||||||
obj->setDenseElementHole(index);
|
obj->setDenseElementHole(index);
|
||||||
return SuppressDeletedProperty(cx, obj, INT_TO_JSID(index));
|
return SuppressDeletedProperty(cx, obj, PropertyKey::Int(index));
|
||||||
};
|
};
|
||||||
|
|
||||||
RootedValue origlo(cx), orighi(cx);
|
RootedValue origlo(cx), orighi(cx);
|
||||||
|
|
|
@ -1199,7 +1199,7 @@ bool BuildImmutableProperty(JSContext* cx, HandleValue value, HandleId name,
|
||||||
// Step 1.b.iv
|
// Step 1.b.iv
|
||||||
for (uint32_t i = 0; i < len; i++) {
|
for (uint32_t i = 0; i < len; i++) {
|
||||||
// Step 1.b.iv.1
|
// Step 1.b.iv.1
|
||||||
childName.set(INT_TO_JSID(i));
|
childName.set(PropertyKey::Int(i));
|
||||||
|
|
||||||
// Step 1.b.iv.2
|
// Step 1.b.iv.2
|
||||||
if (!GetProperty(cx, arr, value, childName, &childValue)) {
|
if (!GetProperty(cx, arr, value, childName, &childValue)) {
|
||||||
|
|
|
@ -4108,7 +4108,7 @@ static bool ReadGeckoProfilingStack(JSContext* cx, unsigned argc, Value* vp) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
idx = INT_TO_JSID(inlineFrameNo);
|
idx = PropertyKey::Int(inlineFrameNo);
|
||||||
if (!JS_DefinePropertyById(cx, inlineStack, idx, inlineFrameInfo, 0)) {
|
if (!JS_DefinePropertyById(cx, inlineStack, idx, inlineFrameInfo, 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -4117,7 +4117,7 @@ static bool ReadGeckoProfilingStack(JSContext* cx, unsigned argc, Value* vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Push inline array into main array.
|
// Push inline array into main array.
|
||||||
idx = INT_TO_JSID(physicalFrameNo);
|
idx = PropertyKey::Int(physicalFrameNo);
|
||||||
if (!JS_DefinePropertyById(cx, stack, idx, inlineStack, 0)) {
|
if (!JS_DefinePropertyById(cx, stack, idx, inlineStack, 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -4210,7 +4210,7 @@ JSObject* ShellAllocationMetadataBuilder::build(
|
||||||
RootedValue callee(cx);
|
RootedValue callee(cx);
|
||||||
for (NonBuiltinScriptFrameIter iter(cx); !iter.done(); ++iter) {
|
for (NonBuiltinScriptFrameIter iter(cx); !iter.done(); ++iter) {
|
||||||
if (iter.isFunctionFrame() && iter.compartment() == cx->compartment()) {
|
if (iter.isFunctionFrame() && iter.compartment() == cx->compartment()) {
|
||||||
id = INT_TO_JSID(stackIndex);
|
id = PropertyKey::Int(stackIndex);
|
||||||
RootedObject callee(cx, iter.callee(cx));
|
RootedObject callee(cx, iter.callee(cx));
|
||||||
if (!JS_DefinePropertyById(cx, stack, id, callee, JSPROP_ENUMERATE)) {
|
if (!JS_DefinePropertyById(cx, stack, id, callee, JSPROP_ENUMERATE)) {
|
||||||
oomUnsafe.crash("ShellAllocationMetadataBuilder::build");
|
oomUnsafe.crash("ShellAllocationMetadataBuilder::build");
|
||||||
|
|
|
@ -1670,7 +1670,7 @@ DebuggerArguments* DebuggerArguments::create(JSContext* cx, HandleObject proto,
|
||||||
if (!getobj) {
|
if (!getobj) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
id = INT_TO_JSID(i);
|
id = PropertyKey::Int(i);
|
||||||
if (!NativeDefineAccessorProperty(cx, obj, id, getobj, nullptr,
|
if (!NativeDefineAccessorProperty(cx, obj, id, getobj, nullptr,
|
||||||
JSPROP_ENUMERATE)) {
|
JSPROP_ENUMERATE)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -1664,7 +1664,7 @@ bool DebuggerScript::CallData::getAllOffsets() {
|
||||||
RootedObject offsets(cx);
|
RootedObject offsets(cx);
|
||||||
RootedValue offsetsv(cx);
|
RootedValue offsetsv(cx);
|
||||||
|
|
||||||
RootedId id(cx, INT_TO_JSID(lineno));
|
RootedId id(cx, PropertyKey::Int(lineno));
|
||||||
|
|
||||||
bool found;
|
bool found;
|
||||||
if (!HasOwnProperty(cx, result, id, &found)) {
|
if (!HasOwnProperty(cx, result, id, &found)) {
|
||||||
|
|
|
@ -134,7 +134,7 @@ bool InterpretObjLiteralObj(JSContext* cx, HandlePlainObject obj,
|
||||||
!insn.getKey().isArrayIndex());
|
!insn.getKey().isArrayIndex());
|
||||||
|
|
||||||
if (kind == PropertySetKind::Normal && insn.getKey().isArrayIndex()) {
|
if (kind == PropertySetKind::Normal && insn.getKey().isArrayIndex()) {
|
||||||
propId = INT_TO_JSID(insn.getKey().getArrayIndex());
|
propId = PropertyKey::Int(insn.getKey().getArrayIndex());
|
||||||
} else {
|
} else {
|
||||||
JSAtom* jsatom =
|
JSAtom* jsatom =
|
||||||
atomCache.getExistingAtomAt(cx, insn.getKey().getAtomIndex());
|
atomCache.getExistingAtomAt(cx, insn.getKey().getAtomIndex());
|
||||||
|
|
|
@ -8,7 +8,7 @@ FRAGMENT(jsid, simple) {
|
||||||
JS::Rooted<JSString*> string(cx, JS_NewStringCopyZ(cx, chars));
|
JS::Rooted<JSString*> string(cx, JS_NewStringCopyZ(cx, chars));
|
||||||
JS::Rooted<JSString*> interned(cx, JS_AtomizeAndPinString(cx, chars));
|
JS::Rooted<JSString*> interned(cx, JS_AtomizeAndPinString(cx, chars));
|
||||||
JS::Rooted<jsid> string_id(cx, JS::PropertyKey::fromPinnedString(interned));
|
JS::Rooted<jsid> string_id(cx, JS::PropertyKey::fromPinnedString(interned));
|
||||||
JS::Rooted<jsid> int_id(cx, INT_TO_JSID(1729));
|
JS::Rooted<jsid> int_id(cx, JS::PropertyKey::Int(1729));
|
||||||
JS::Rooted<jsid> unique_symbol_id(
|
JS::Rooted<jsid> unique_symbol_id(
|
||||||
cx, SYMBOL_TO_JSID(JS::NewSymbol(cx, interned)));
|
cx, SYMBOL_TO_JSID(JS::NewSymbol(cx, interned)));
|
||||||
JS::Rooted<jsid> registry_symbol_id(
|
JS::Rooted<jsid> registry_symbol_id(
|
||||||
|
|
|
@ -1928,7 +1928,7 @@ bool HasNativeElementPure(JSContext* cx, NativeObject* obj, int32_t index,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
jsid id = INT_TO_JSID(index);
|
jsid id = PropertyKey::Int(index);
|
||||||
uint32_t unused;
|
uint32_t unused;
|
||||||
if (obj->shape()->lookup(cx, id, &unused)) {
|
if (obj->shape()->lookup(cx, id, &unused)) {
|
||||||
vp[0].setBoolean(true);
|
vp[0].setBoolean(true);
|
||||||
|
|
|
@ -719,7 +719,7 @@ bool MappedArgumentsObject::obj_enumerate(JSContext* cx, HandleObject obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < argsobj->initialLength(); i++) {
|
for (unsigned i = 0; i < argsobj->initialLength(); i++) {
|
||||||
id = INT_TO_JSID(i);
|
id = PropertyKey::Int(i);
|
||||||
if (!HasOwnProperty(cx, argsobj, id, &found)) {
|
if (!HasOwnProperty(cx, argsobj, id, &found)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1006,7 +1006,7 @@ bool UnmappedArgumentsObject::obj_enumerate(JSContext* cx, HandleObject obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < argsobj->initialLength(); i++) {
|
for (unsigned i = 0; i < argsobj->initialLength(); i++) {
|
||||||
id = INT_TO_JSID(i);
|
id = PropertyKey::Int(i);
|
||||||
if (!HasOwnProperty(cx, argsobj, id, &found)) {
|
if (!HasOwnProperty(cx, argsobj, id, &found)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,7 @@ static bool EnumerateNativeProperties(JSContext* cx, HandleNativeObject pobj,
|
||||||
} else {
|
} else {
|
||||||
// Dense arrays never get so large that i would not fit into an
|
// Dense arrays never get so large that i would not fit into an
|
||||||
// integer id.
|
// integer id.
|
||||||
if (!Enumerate<CheckForDuplicates>(cx, pobj, INT_TO_JSID(i),
|
if (!Enumerate<CheckForDuplicates>(cx, pobj, PropertyKey::Int(i),
|
||||||
/* enumerable = */ true, flags,
|
/* enumerable = */ true, flags,
|
||||||
visited, props)) {
|
visited, props)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -244,7 +244,7 @@ static bool EnumerateNativeProperties(JSContext* cx, HandleNativeObject pobj,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < len; i++) {
|
for (size_t i = 0; i < len; i++) {
|
||||||
if (!Enumerate<CheckForDuplicates>(cx, pobj, INT_TO_JSID(i),
|
if (!Enumerate<CheckForDuplicates>(cx, pobj, PropertyKey::Int(i),
|
||||||
/* enumerable = */ true, flags,
|
/* enumerable = */ true, flags,
|
||||||
visited, props)) {
|
visited, props)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -25,7 +25,7 @@ MOZ_ALWAYS_INLINE jsid AtomToId(JSAtom* atom) {
|
||||||
|
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
if (atom->isIndex(&index) && index <= JSID_INT_MAX) {
|
if (atom->isIndex(&index) && index <= JSID_INT_MAX) {
|
||||||
return INT_TO_JSID(int32_t(index));
|
return JS::PropertyKey::Int(int32_t(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
return JS::PropertyKey::fromNonIntAtom(atom);
|
return JS::PropertyKey::fromNonIntAtom(atom);
|
||||||
|
@ -42,11 +42,11 @@ MOZ_ALWAYS_INLINE bool ValueToIntId(const Value& v, jsid* id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!INT_FITS_IN_JSID(i)) {
|
if (!PropertyKey::fitsInInt(i)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*id = INT_TO_JSID(i);
|
*id = PropertyKey::Int(i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ bool IndexToIdSlow(JSContext* cx, uint32_t index, MutableHandleId idp);
|
||||||
|
|
||||||
inline bool IndexToId(JSContext* cx, uint32_t index, MutableHandleId idp) {
|
inline bool IndexToId(JSContext* cx, uint32_t index, MutableHandleId idp) {
|
||||||
if (index <= JSID_INT_MAX) {
|
if (index <= JSID_INT_MAX) {
|
||||||
idp.set(INT_TO_JSID(index));
|
idp.set(PropertyKey::Int(index));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ inline void NativeObject::setDenseElementHole(uint32_t index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void NativeObject::removeDenseElementForSparseIndex(uint32_t index) {
|
inline void NativeObject::removeDenseElementForSparseIndex(uint32_t index) {
|
||||||
MOZ_ASSERT(containsPure(INT_TO_JSID(index)));
|
MOZ_ASSERT(containsPure(PropertyKey::Int(index)));
|
||||||
if (containsDenseElement(index)) {
|
if (containsDenseElement(index)) {
|
||||||
setDenseElementHole(index);
|
setDenseElementHole(index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1071,7 +1071,7 @@ static MOZ_ALWAYS_INLINE bool CallAddPropertyHookDense(JSContext* cx,
|
||||||
if (MOZ_UNLIKELY(addProperty)) {
|
if (MOZ_UNLIKELY(addProperty)) {
|
||||||
MOZ_ASSERT(!cx->isHelperThreadContext());
|
MOZ_ASSERT(!cx->isHelperThreadContext());
|
||||||
|
|
||||||
RootedId id(cx, INT_TO_JSID(index));
|
RootedId id(cx, PropertyKey::Int(index));
|
||||||
if (!CallJSAddPropertyOp(cx, addProperty, obj, id, value)) {
|
if (!CallJSAddPropertyOp(cx, addProperty, obj, id, value)) {
|
||||||
obj->setDenseElementHole(index);
|
obj->setDenseElementHole(index);
|
||||||
return false;
|
return false;
|
||||||
|
@ -1807,8 +1807,8 @@ static bool DefineNonexistentProperty(JSContext* cx, HandleNativeObject obj,
|
||||||
bool js::AddOrUpdateSparseElementHelper(JSContext* cx, HandleArrayObject obj,
|
bool js::AddOrUpdateSparseElementHelper(JSContext* cx, HandleArrayObject obj,
|
||||||
int32_t int_id, HandleValue v,
|
int32_t int_id, HandleValue v,
|
||||||
bool strict) {
|
bool strict) {
|
||||||
MOZ_ASSERT(INT_FITS_IN_JSID(int_id));
|
MOZ_ASSERT(PropertyKey::fitsInInt(int_id));
|
||||||
RootedId id(cx, INT_TO_JSID(int_id));
|
RootedId id(cx, PropertyKey::Int(int_id));
|
||||||
|
|
||||||
// This helper doesn't handle the case where the index may be in the dense
|
// This helper doesn't handle the case where the index may be in the dense
|
||||||
// elements
|
// elements
|
||||||
|
@ -2095,8 +2095,8 @@ bool js::GetSparseElementHelper(JSContext* cx, HandleArrayObject obj,
|
||||||
MOZ_ASSERT_IF(obj->staticPrototype() != nullptr,
|
MOZ_ASSERT_IF(obj->staticPrototype() != nullptr,
|
||||||
!ObjectMayHaveExtraIndexedProperties(obj->staticPrototype()));
|
!ObjectMayHaveExtraIndexedProperties(obj->staticPrototype()));
|
||||||
|
|
||||||
MOZ_ASSERT(INT_FITS_IN_JSID(int_id));
|
MOZ_ASSERT(PropertyKey::fitsInInt(int_id));
|
||||||
RootedId id(cx, INT_TO_JSID(int_id));
|
RootedId id(cx, PropertyKey::Int(int_id));
|
||||||
|
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
PropMap* map = obj->shape()->lookup(cx, id, &index);
|
PropMap* map = obj->shape()->lookup(cx, id, &index);
|
||||||
|
|
|
@ -207,7 +207,7 @@ inline bool GetElementNoGC(JSContext* cx, JSObject* obj,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetPropertyNoGC(cx, obj, receiver, INT_TO_JSID(index), vp);
|
return GetPropertyNoGC(cx, obj, receiver, PropertyKey::Int(index), vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MOZ_ALWAYS_INLINE bool ClassMayResolveId(const JSAtomState& names,
|
static MOZ_ALWAYS_INLINE bool ClassMayResolveId(const JSAtomState& names,
|
||||||
|
|
|
@ -1102,7 +1102,7 @@ static MOZ_ALWAYS_INLINE void MakeRangeGCSafe(Value* beg, Value* end) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static MOZ_ALWAYS_INLINE void MakeRangeGCSafe(jsid* beg, jsid* end) {
|
static MOZ_ALWAYS_INLINE void MakeRangeGCSafe(jsid* beg, jsid* end) {
|
||||||
std::fill(beg, end, INT_TO_JSID(0));
|
std::fill(beg, end, PropertyKey::Int(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static MOZ_ALWAYS_INLINE void MakeRangeGCSafe(jsid* vec, size_t len) {
|
static MOZ_ALWAYS_INLINE void MakeRangeGCSafe(jsid* vec, size_t len) {
|
||||||
|
|
|
@ -1469,7 +1469,7 @@ static bool TryAppendNativeProperties(JSContext* cx, HandleObject obj,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entries.append(INT_TO_JSID(i - 1))) {
|
if (!entries.append(PropertyKey::Int(i - 1))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -598,7 +598,7 @@ bool TypedObject::obj_newEnumerate(JSContext* cx, HandleObject obj,
|
||||||
}
|
}
|
||||||
RootedId id(cx);
|
RootedId id(cx);
|
||||||
for (size_t index = 0; index < indexCount; index++) {
|
for (size_t index = 0; index < indexCount; index++) {
|
||||||
id = INT_TO_JSID(index);
|
id = PropertyKey::Int(index);
|
||||||
properties.infallibleAppend(id);
|
properties.infallibleAppend(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -946,7 +946,7 @@ bool JSXrayTraits::enumerateNames(JSContext* cx, HandleObject wrapper,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (int32_t i = 0; i < int32_t(length); ++i) {
|
for (int32_t i = 0; i < int32_t(length); ++i) {
|
||||||
props.infallibleAppend(INT_TO_JSID(i));
|
props.infallibleAppend(PropertyKey::Int(i));
|
||||||
}
|
}
|
||||||
} else if (key == JSProto_Function) {
|
} else if (key == JSProto_Function) {
|
||||||
if (!props.append(GetJSIDByIndex(cx, XPCJSContext::IDX_LENGTH))) {
|
if (!props.append(GetJSIDByIndex(cx, XPCJSContext::IDX_LENGTH))) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче