Last Comment Bug 780051 - convert JS_MIN and JS_MAX to emeritus status
: convert JS_MIN and JS_MAX to emeritus status
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: :Benjamin Peterson
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-02 17:43 PDT by :Benjamin Peterson
Modified: 2012-08-03 07:32 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
kill 'em (20.84 KB, patch)
2012-08-02 17:57 PDT, :Benjamin Peterson
luke: review+
Details | Diff | Splinter Review

Description :Benjamin Peterson 2012-08-02 17:43:59 PDT
We have perfectly nice typed replacements: Min and Max. JS_MIN and JS_MAX should die before some other innocent soul starts using them.
Comment 1 :Benjamin Peterson 2012-08-02 17:57:49 PDT
Created attachment 648584 [details] [diff] [review]
kill 'em

This is fairly straightforward. Being templates, Min and Max are persnickety about their types; I had to add a bit of casting. I also had to inline one JS_MIN in jsd.
Comment 2 Luke Wagner [:luke] 2012-08-02 18:08:25 PDT
Comment on attachment 648584 [details] [diff] [review]
kill 'em

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

I'd try server with "try: -b do -p all -u none -t none" to make sure there are no surprise template compiler errors and catch any surprise uses outside js/src.

::: js/src/json.cpp
@@ +701,5 @@
>      if (space.isNumber()) {
>          /* Step 6. */
>          double d;
>          JS_ALWAYS_TRUE(ToInteger(cx, space, &d));
> +        d = Min(10., d);

How about 10.0 instead?
Comment 3 :Benjamin Peterson 2012-08-02 18:13:01 PDT
(In reply to Luke Wagner [:luke] from comment #2)
> Comment on attachment 648584 [details] [diff] [review]
> kill 'em
> 
> Review of attachment 648584 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I'd try server with "try: -b do -p all -u none -t none" to make sure there
> are no surprise template compiler errors and catch any surprise uses outside
> js/src.
> 
> ::: js/src/json.cpp
> @@ +701,5 @@
> >      if (space.isNumber()) {
> >          /* Step 6. */
> >          double d;
> >          JS_ALWAYS_TRUE(ToInteger(cx, space, &d));
> > +        d = Min(10., d);
> 
> How about 10.0 instead?

Okay.
Comment 5 Ed Morley [:emorley] 2012-08-03 07:32:20 PDT
https://hg.mozilla.org/mozilla-central/rev/20c3e03a259a

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