Backout the bug 754202 backout due to orange.
This commit is contained in:
@@ -2613,17 +2613,15 @@ js_Date(JSContext *cx, unsigned argc, Value *vp)
|
||||
/* Date called as constructor. */
|
||||
double d;
|
||||
if (args.length() == 0) {
|
||||
/* ES5 15.9.3.3. */
|
||||
d = NowAsMillis();
|
||||
} else if (args.length() == 1) {
|
||||
/* ES5 15.9.3.2. */
|
||||
|
||||
/* Step 1. */
|
||||
if (!ToPrimitive(cx, &args[0]))
|
||||
return false;
|
||||
|
||||
if (args[0].isString()) {
|
||||
/* Step 2. */
|
||||
if (!args[0].isString()) {
|
||||
/* the argument is a millisecond number */
|
||||
if (!ToNumber(cx, args[0], &d))
|
||||
return false;
|
||||
d = TimeClip(d);
|
||||
} else {
|
||||
/* the argument is a string; parse it. */
|
||||
JSString *str = ToString(cx, args[0]);
|
||||
if (!str)
|
||||
return false;
|
||||
@@ -2636,11 +2634,6 @@ js_Date(JSContext *cx, unsigned argc, Value *vp)
|
||||
d = js_NaN;
|
||||
else
|
||||
d = TimeClip(d);
|
||||
} else {
|
||||
/* Step 3. */
|
||||
if (!ToNumber(cx, args[0], &d))
|
||||
return false;
|
||||
d = TimeClip(d);
|
||||
}
|
||||
} else {
|
||||
double msec_time;
|
||||
|
||||
Reference in New Issue
Block a user