DatePrototype: In ES6, this is an Object, not a DateObject

Quoting 20.3.4:
    The Date prototype object is the intrinsic object %DatePrototype%. The Date
    prototype object is itself an ordinary object. It is not a Date instance
    and does not have a [[DateValue]] internal slot.

Aside from Symbol failures (which we expect, because we don't have a
Symbol implementation at this time), Date.prototype only has these two
failures left in ES6:

    setFullYear/new-value-time-clip in strict mode
    setFullYear/new-value-time-clip in non-strict mode
    setMonth/new-value-time-clip in strict mode
    setMonth/new-value-time-clip in non-strict mode

These seem to be related to handling of overflow conditions.

Change-Id: I0b7f65fbef3f709ff56ecfc8e5a5d5cf974b7515
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Robin Burchell 2017-02-04 13:01:35 +01:00
parent d4d460ffbd
commit d6280f7729
3 changed files with 5 additions and 10 deletions

View File

@ -112,7 +112,7 @@ struct DateCtor: FunctionObject
static void call(const Managed *that, Scope &scope, CallData *);
};
struct DatePrototype: DateObject
struct DatePrototype: Object
{
void init(ExecutionEngine *engine, Object *ctor);

View File

@ -566,10 +566,6 @@ void tst_QJSEngine::newDate()
QCOMPARE(date.isDate(), true);
QCOMPARE(date.isObject(), true);
QVERIFY(!date.isCallable());
// prototype should be Date.prototype
QVERIFY(!date.prototype().isUndefined());
QCOMPARE(date.prototype().isDate(), true);
QCOMPARE(date.prototype().strictlyEquals(eng.evaluate("Date.prototype")), true);
}
{
@ -578,10 +574,6 @@ void tst_QJSEngine::newDate()
QVERIFY(!date.isUndefined());
QCOMPARE(date.isDate(), true);
QCOMPARE(date.isObject(), true);
// prototype should be Date.prototype
QVERIFY(!date.prototype().isUndefined());
QCOMPARE(date.prototype().isDate(), true);
QCOMPARE(date.prototype().strictlyEquals(eng.evaluate("Date.prototype")), true);
QCOMPARE(date.toDateTime(), dt);
}

View File

@ -128,9 +128,12 @@ S15.10.6.2_A9 failing
S15.10.6.3_A9 failing
S15.10.6.4_A9 failing
# Object.freeze(v) on a non-object returns v, no longer TypeError
# es6: Object.freeze(v) on a non-object returns v, no longer TypeError
15.2.3.9-1 failing
15.2.3.9-1-1 failing
15.2.3.9-1-2 failing
15.2.3.9-1-3 failing
15.2.3.9-1-4 failing
# es6: Date.prototype is no longer a DateObject
15.9.5.40_1 failing