Bug 1312948: Revert "Bug 1310744: A frozen element has no writable length. r=nbp". r=nbp

These track two different concepts, and even though they're related, we
shouldn't stick them together this way.

MozReview-Commit-ID: EyM5MgrisX4
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
This commit is contained in:
Emilio Cobos Álvarez 2016-10-26 12:01:50 +02:00
Родитель 0983850a63
Коммит 7a8a1e5e91
2 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -573,8 +573,7 @@ js::ArraySetLength(JSContext* cx, Handle<ArrayObject*> arr, HandleId id,
{
RootedShape lengthShape(cx, arr->lookupPure(id));
MOZ_ASSERT(lengthShape);
MOZ_ASSERT_IF(lengthIsWritable, lengthShape->writable());
MOZ_ASSERT_IF(lengthShape->writable() && !lengthIsWritable, arr->denseElementsAreFrozen());
MOZ_ASSERT(lengthShape->writable() == lengthIsWritable);
}
#endif
uint32_t oldLen = arr->length();

Просмотреть файл

@ -228,8 +228,7 @@ class ObjectElements
flags &= ~CONVERT_DOUBLE_ELEMENTS;
}
bool hasNonwritableArrayLength() const {
return flags & NONWRITABLE_ARRAY_LENGTH ||
flags & FROZEN;
return flags & NONWRITABLE_ARRAY_LENGTH;
}
void setNonwritableArrayLength() {
MOZ_ASSERT(!isCopyOnWrite());