Closed Bug 939909 Opened 6 years ago Closed 6 years ago

Internal Promise implementation should not use Optional<JS::Handle<JS::Value> > forms

Categories

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

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: nsm, Assigned: nsm)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

JS::Value already encodes the semantics of optional, this is redundant, especially in internal methods that are not wired to WebIDL. bz eventually plans to get rid of the |optional any| webidl form too.
Assignee: nobody → nsm.nikhil
Depends on: promises
Comment on attachment 8334187 [details] [diff] [review]
Get rid of Optional<> from internal functions.

>@@ -315,19 +315,19 @@ Promise::JSCallback(JSContext *aCx, unsi
>+  JS::Rooted<JS::Value> value(aCx);
>   if (aArgc) {
>-    value.Value() = args[0];
>+    value = args[0];

  JS::Rooted<JS::Value> value(aCx, args.get(0));

Or even more simply, just pass args.get(0) in the places where "value" is passed right now and remove all this code.

Apart from that, looks great.  Thank you for doing this!

r=me
Attachment #8334187 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/66ab5cb18c25
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.