Bug 1619007 - Part 2: Remove unnecessary is<T> tests when directly followed by as<T>. r=mgaudet

The standard convention is to omit a `is<T>` test when it is directly followed
by `as<T>`, because `as<T>` is also testing for `is<T>`.

Depends on D65768

Differential Revision: https://phabricator.services.mozilla.com/D65769

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2020-03-06 20:21:35 +00:00
Родитель d5b122477c
Коммит ecab1ebe4b
1 изменённых файлов: 0 добавлений и 3 удалений

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

@ -8547,10 +8547,8 @@ bool BytecodeEmitter::emitPropertyListObjLiteral(ListNode* obj,
bool singleton = flags.contains(ObjLiteralFlag::Singleton);
for (ParseNode* propdef : obj->contents()) {
MOZ_ASSERT(propdef->is<BinaryNode>());
BinaryNode* prop = &propdef->as<BinaryNode>();
ParseNode* key = prop->left();
MOZ_ASSERT(key->is<NameNode>() || key->is<NumericLiteral>());
if (key->is<NameNode>()) {
uint32_t propNameIndex = 0;
@ -8559,7 +8557,6 @@ bool BytecodeEmitter::emitPropertyListObjLiteral(ListNode* obj,
}
data.writer().setPropName(propNameIndex);
} else {
MOZ_ASSERT(key->is<NumericLiteral>());
double numValue = key->as<NumericLiteral>().value();
int32_t i = 0;
DebugOnly<bool> numIsInt =