mirror of
https://github.com/bellard/quickjs.git
synced 2025-05-13 03:15:20 +08:00
fixed set_date_field()
This commit is contained in:
parent
d045a13b4b
commit
b0c1a12196
@ -49241,7 +49241,7 @@ static JSValue set_date_field(JSContext *ctx, JSValueConst this_val,
|
|||||||
{
|
{
|
||||||
// _field(obj, first_field, end_field, args, is_local)
|
// _field(obj, first_field, end_field, args, is_local)
|
||||||
double fields[9];
|
double fields[9];
|
||||||
int res, first_field, end_field, is_local, i, n;
|
int res, first_field, end_field, is_local, i, n, res1;
|
||||||
double d, a;
|
double d, a;
|
||||||
|
|
||||||
d = NAN;
|
d = NAN;
|
||||||
@ -49252,6 +49252,7 @@ static JSValue set_date_field(JSContext *ctx, JSValueConst this_val,
|
|||||||
res = get_date_fields(ctx, this_val, fields, is_local, first_field == 0);
|
res = get_date_fields(ctx, this_val, fields, is_local, first_field == 0);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return JS_EXCEPTION;
|
return JS_EXCEPTION;
|
||||||
|
res1 = res;
|
||||||
|
|
||||||
// Argument coercion is observable and must be done unconditionally.
|
// Argument coercion is observable and must be done unconditionally.
|
||||||
n = min_int(argc, end_field - first_field);
|
n = min_int(argc, end_field - first_field);
|
||||||
@ -49262,6 +49263,10 @@ static JSValue set_date_field(JSContext *ctx, JSValueConst this_val,
|
|||||||
res = FALSE;
|
res = FALSE;
|
||||||
fields[first_field + i] = trunc(a);
|
fields[first_field + i] = trunc(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!res1)
|
||||||
|
return JS_NAN; /* thisTimeValue is NaN */
|
||||||
|
|
||||||
if (res && argc > 0)
|
if (res && argc > 0)
|
||||||
d = set_date_fields(fields, is_local);
|
d = set_date_fields(fields, is_local);
|
||||||
|
|
||||||
|
@ -25,30 +25,6 @@ test262/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined-retu
|
|||||||
test262/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined-return-object.js:66: strict mode: TypeError: $DONE() not called
|
test262/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined-return-object.js:66: strict mode: TypeError: $DONE() not called
|
||||||
test262/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js:41: TypeError: $DONE() not called
|
test262/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js:41: TypeError: $DONE() not called
|
||||||
test262/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js:41: strict mode: TypeError: $DONE() not called
|
test262/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js:41: strict mode: TypeError: $DONE() not called
|
||||||
test262/test/built-ins/Date/prototype/setDate/date-value-read-before-tonumber-when-date-is-invalid.js:25: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setDate/date-value-read-before-tonumber-when-date-is-invalid.js:25: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setHours/date-value-read-before-tonumber-when-date-is-invalid.js:28: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setHours/date-value-read-before-tonumber-when-date-is-invalid.js:28: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setMilliseconds/date-value-read-before-tonumber-when-date-is-invalid.js:25: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setMilliseconds/date-value-read-before-tonumber-when-date-is-invalid.js:25: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setMinutes/date-value-read-before-tonumber-when-date-is-invalid.js:27: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setMinutes/date-value-read-before-tonumber-when-date-is-invalid.js:27: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setMonth/date-value-read-before-tonumber-when-date-is-invalid.js:26: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setMonth/date-value-read-before-tonumber-when-date-is-invalid.js:26: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setSeconds/date-value-read-before-tonumber-when-date-is-invalid.js:26: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setSeconds/date-value-read-before-tonumber-when-date-is-invalid.js:26: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCDate/date-value-read-before-tonumber-when-date-is-invalid.js:25: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCDate/date-value-read-before-tonumber-when-date-is-invalid.js:25: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCHours/date-value-read-before-tonumber-when-date-is-invalid.js:28: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCHours/date-value-read-before-tonumber-when-date-is-invalid.js:28: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCMilliseconds/date-value-read-before-tonumber-when-date-is-invalid.js:25: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCMilliseconds/date-value-read-before-tonumber-when-date-is-invalid.js:25: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCMinutes/date-value-read-before-tonumber-when-date-is-invalid.js:27: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCMinutes/date-value-read-before-tonumber-when-date-is-invalid.js:27: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCMonth/date-value-read-before-tonumber-when-date-is-invalid.js:26: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCMonth/date-value-read-before-tonumber-when-date-is-invalid.js:26: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCSeconds/date-value-read-before-tonumber-when-date-is-invalid.js:26: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Date/prototype/setUTCSeconds/date-value-read-before-tonumber-when-date-is-invalid.js:26: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true
|
|
||||||
test262/test/built-ins/Function/prototype/arguments/prop-desc.js:31: Test262Error: Function.prototype.arguments property getter/setter are the same function Expected SameValue(«function () {
|
test262/test/built-ins/Function/prototype/arguments/prop-desc.js:31: Test262Error: Function.prototype.arguments property getter/setter are the same function Expected SameValue(«function () {
|
||||||
[native code]
|
[native code]
|
||||||
}», «function () {
|
}», «function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user