The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla15

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

unspecified
mozilla15
x86
Mac OS X
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Short story: C++ traits templates in a header, much simpler codegen code.
Created attachment 618138 [details] [diff] [review]
Refactor argument conversion to primitive values to make it easier to extend in the future.
Attachment #618138 - Flags: review?(peterv)
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.