mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Issue #2197 - Part 1a: postMessages should have transferable as [] by default
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1336020
This commit is contained in:
parent
7c759b2c21
commit
438cdbd913
22 changed files with 52 additions and 58 deletions
|
|
@ -8888,18 +8888,17 @@ nsGlobalWindow::PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
|||
void
|
||||
nsGlobalWindow::PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
const nsAString& aTargetOrigin,
|
||||
const Optional<Sequence<JS::Value>>& aTransfer,
|
||||
const Sequence<JS::Value>& aTransfer,
|
||||
nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aError)
|
||||
{
|
||||
JS::Rooted<JS::Value> transferArray(aCx, JS::UndefinedValue());
|
||||
if (aTransfer.WasPassed()) {
|
||||
const Sequence<JS::Value >& values = aTransfer.Value();
|
||||
|
||||
if (!aTransfer.IsEmpty()) {
|
||||
// The input sequence only comes from the generated bindings code, which
|
||||
// ensures it is rooted.
|
||||
JS::HandleValueArray elements =
|
||||
JS::HandleValueArray::fromMarkedLocation(values.Length(), values.Elements());
|
||||
JS::HandleValueArray::fromMarkedLocation(aTransfer.Length(),
|
||||
aTransfer.Elements());
|
||||
|
||||
transferArray = JS::ObjectOrNullValue(JS_NewArrayObject(aCx, elements));
|
||||
if (transferArray.isNull()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue