mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Construct URLSearchParams from record<>
This commit is contained in:
parent
5fc488fe61
commit
1729192b5d
3 changed files with 10 additions and 4 deletions
|
|
@ -327,7 +327,7 @@ URLSearchParams::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|||
|
||||
/* static */ already_AddRefed<URLSearchParams>
|
||||
URLSearchParams::Constructor(const GlobalObject& aGlobal,
|
||||
const USVStringSequenceSequenceOrUSVString& aInit,
|
||||
const USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString& aInit,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
RefPtr<URLSearchParams> sp =
|
||||
|
|
@ -351,6 +351,12 @@ URLSearchParams::Constructor(const GlobalObject& aGlobal,
|
|||
}
|
||||
sp->Append(item[0], item[1]);
|
||||
}
|
||||
} else if (aInit.IsUSVStringUSVStringRecord()) {
|
||||
const Record<nsString, nsString>& record =
|
||||
aInit.GetAsUSVStringUSVStringRecord();
|
||||
for (auto& entry : record.Entries()) {
|
||||
sp->Append(entry.mKey, entry.mValue);
|
||||
}
|
||||
} else {
|
||||
MOZ_CRASH("This should not happen.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue