Closed Bug 748637 Opened 8 years ago Closed 8 years ago

Refactor primitive value argument conversion to make it more readable/scalable

Categories

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

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

Short story: C++ traits templates in a header, much simpler codegen code.
Comment on attachment 618138 [details] [diff] [review]
Refactor argument conversion to primitive values to make it easier to extend in the future.

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

Lovely!

::: dom/bindings/PrimitiveConversions.h
@@ +8,5 @@
> + * Conversions from jsval to primitive values
> + */
> +
> +#ifndef mozilla_dom_PrimitiveConversions_h__
> +#define mozilla_dom_PrimitiveConversions_h__

Nit: no trailing underscores, please.

@@ +109,5 @@
> +  }
> +};
> +template<>
> +struct PrimitiveConversionTraits<float> : PrimitiveConversionTraits_float {
> +};

I guess this doesn't change behaviour, but is it correct?
> I guess this doesn't change behaviour, but is it correct?

I believe so, yes.  Which part looks wrong to you?
Whiteboard: [need review]
> Nit: no trailing underscores, please.

Sure.
Attachment #618138 - Flags: review?(peterv) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/e0a8b01b259a
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/e0a8b01b259a
Status: NEW → RESOLVED
Closed: 8 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.