Bug 1492011 replace ArgumentsToValueList instance method with nsTArray::AppendElements() r=baku

Depends on D67992

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2020-03-24 09:02:16 +00:00
Родитель 3ec04c339f
Коммит 15ee47208b
1 изменённых файлов: 3 добавлений и 14 удалений

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

@ -1624,7 +1624,7 @@ bool Console::PopulateConsoleNotificationInTheTargetScope(
default:
event.mArguments.Construct();
if (NS_WARN_IF(
!ArgumentsToValueList(aArguments, event.mArguments.Value()))) {
!event.mArguments.Value().AppendElements(aArguments, fallible))) {
return false;
}
}
@ -1751,7 +1751,7 @@ bool Console::ProcessArguments(JSContext* aCx, const Sequence<JS::Value>& aData,
}
if (aData.Length() == 1 || !aData[0].isString()) {
return ArgumentsToValueList(aData, aSequence);
return aSequence.AppendElements(aData, fallible);
}
JS::Rooted<JS::Value> format(aCx, aData[0]);
@ -1766,7 +1766,7 @@ bool Console::ProcessArguments(JSContext* aCx, const Sequence<JS::Value>& aData,
}
if (string.IsEmpty()) {
return ArgumentsToValueList(aData, aSequence);
return aSequence.AppendElements(aData, fallible);
}
nsString::const_iterator start, end;
@ -2193,17 +2193,6 @@ JS::Value Console::CreateTimerError(JSContext* aCx, const nsAString& aLabel,
return value;
}
bool Console::ArgumentsToValueList(const Sequence<JS::Value>& aData,
Sequence<JS::Value>& aSequence) const {
for (uint32_t i = 0; i < aData.Length(); ++i) {
if (NS_WARN_IF(!aSequence.AppendElement(aData[i], fallible))) {
return false;
}
}
return true;
}
uint32_t Console::IncreaseCounter(JSContext* aCx,
const Sequence<JS::Value>& aArguments,
nsAString& aCountLabel) {