Closed Bug 856841 Opened 11 years ago Closed 11 years ago

JS implemented ifaces have an unnecessary JSContext* for |any| attributes' getters/setters

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: reuben, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

      No description provided.
Ugh, I managed to press some key combination that filed the bug.

For example:

[JSImplementation="@mozilla.org/contactField;1"]
interface ContactField {
  attribute any       type;
};

generates:

JS::Value
ContactField::GetType(JSContext* cx, ErrorResult& aRv) const
{
  return mImpl->GetType(cx, aRv);
}

GetType is:

JS::Value GetType(ErrorResult& aRv, ExceptionHandling aExceptionHandling = eReportExceptions);
Blocks: 850430
Summary: JS implemented ifaces have a JSContext* for |any (JS::Value) attribute getters/setters, which isn't necessary. → JS implemented ifaces have an unnecessary JSContext* for |any| attributes' getters/setters
(In reply to Reuben Morais [:reuben] from comment #1)
> GetType is:
> 
> JS::Value GetType(ErrorResult& aRv, ExceptionHandling aExceptionHandling =
> eReportExceptions);

I mean ContactFieldJSImpl::GetType.
My guess is that the any argument creates an "implicit implicit JS Context", which is presumably unnecessary for JS-implemented things.
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Comment on attachment 732162 [details] [diff] [review]
Don't pass in an implicit JSContext based on argument or return value types for JS-implemented interfaces.

Review of attachment 732162 [details] [diff] [review]:
-----------------------------------------------------------------

Nice.
Attachment #732162 - Flags: review?(continuation) → review+
Depends on: 852219
https://hg.mozilla.org/integration/mozilla-inbound/rev/87326badb104
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla23
https://hg.mozilla.org/mozilla-central/rev/87326badb104
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: