Last Comment Bug 748637 - Refactor primitive value argument conversion to make it more readable/scalable
: Refactor primitive value argument conversion to make it more readable/scalable
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla15
Assigned To: Boris Zbarsky [:bz] (still a bit busy)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: 748267
  Show dependency treegraph
 
Reported: 2012-04-24 19:25 PDT by Boris Zbarsky [:bz] (still a bit busy)
Modified: 2012-05-05 03:39 PDT (History)
2 users (show)
bzbarsky: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Refactor argument conversion to primitive values to make it easier to extend in the future. (11.46 KB, patch)
2012-04-24 19:34 PDT, Boris Zbarsky [:bz] (still a bit busy)
peterv: review+
Details | Diff | Splinter Review

Description Boris Zbarsky [:bz] (still a bit busy) 2012-04-24 19:25:03 PDT
Short story: C++ traits templates in a header, much simpler codegen code.
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2012-04-24 19:34:29 PDT
Created attachment 618138 [details] [diff] [review]
Refactor argument conversion to primitive values to make it easier to extend in the future.
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-04-25 00:24:27 PDT
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?
Comment 3 Boris Zbarsky [:bz] (still a bit busy) 2012-04-25 01:36:52 PDT
> I guess this doesn't change behaviour, but is it correct?

I believe so, yes.  Which part looks wrong to you?
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2012-04-25 22:13:09 PDT
> Nit: no trailing underscores, please.

Sure.
Comment 5 Boris Zbarsky [:bz] (still a bit busy) 2012-05-04 09:40:35 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/e0a8b01b259a
Comment 6 :Ms2ger (⌚ UTC+1/+2) 2012-05-05 03:39:44 PDT
https://hg.mozilla.org/mozilla-central/rev/e0a8b01b259a

Note You need to log in before you can comment on or make changes to this bug.