Closed Bug 994453 Opened 6 years ago Closed 6 years ago

Create some utility methods for JS-wrapping C++ values

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(2 files)

Basically factoring out the stuff in Promise.h right now.
1)  Renamed them to ToJS.
2)  Inlined the boolean overload.
3)  Added overloads that take integer types.
4)  Changed the order of the aCx and aArgument arguments so aCx comes first.
5)  Renamed "abv" to "obj" in the typed array overload.
Attachment #8404401 - Flags: review?(bobbyholley)
Whiteboard: [need review]
Comment on attachment 8404401 [details] [diff] [review]
part 1.  Factor out the to-JS conversions from Promise.h into mozilla::dom::ToJS methods.   from moving the methods, I made the following changes:

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

r=me with that (which we also discussed on IRC)

::: dom/bindings/ToJS.h
@@ +4,5 @@
> + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
> + * You can obtain one at http://mozilla.org/MPL/2.0/. */
> +
> +#ifndef mozilla_dom_ToJS_h
> +#define mozilla_dom_ToJS_h

It seems like it would be a lot clearer to call this stuff "ToJSValue". Is there any reason not to do that?
Attachment #8404401 - Flags: review?(bobbyholley) → review+
Attachment #8404402 - Flags: review?(bobbyholley) → review+
https://hg.mozilla.org/mozilla-central/rev/4420ba8e8b32
https://hg.mozilla.org/mozilla-central/rev/45d3f9cfb0df
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.