Implement WrappedJSToDictionary()

RESOLVED FIXED in mozilla34

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mikeh, Assigned: mikeh)

Tracking

unspecified
mozilla34
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

e.g.

--- Foo.webidl ---
dictionary Foo {
  DOMString bar;
  any       baz;
};

--- Foo.js ---
Services.obs.notifyObservers({bar: "BAR", baz: true}, "foo-topic");

--- Foo.cpp ---
#include "mozilla/dom/FooBinding.h"
#include "mozilla/dom/BindingUtils.h"

nsresult
FooClass::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
{
  if (strcmp(aTopic, "foo-topic") == 0) {
    Foo foo;

    if (!WrappedJSToDictionary(aSubject, foo)) {
      return NS_ERROR_INVALID_ARG;
    }

    HandleFoo(foo);
  }
  return NS_OK;
}
Attachment #8477654 - Flags: review?(bzbarsky)
Comment on attachment 8477654 [details] [diff] [review]
Implement WrappedJSToDictionary(), v1

Local style is JS::Rooted<JSObject*> and JS::Rooted<JS::Value> instead of RootedObject and RootedValue.

r=me with that; sorry that took so long.
Attachment #8477654 - Flags: review?(bzbarsky) → review+
Use correct local style; carrying r+ forward.
Assignee: nobody → mhabicher
Attachment #8477654 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8478563 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/35be32fbb756
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.