Fix keywords test

The reserved keywords are allowed as property names in objects.

Change-Id: I5e0025ff374e0e154df81590660fc96b5c529ea4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
Lars Knoll 2013-05-04 23:57:45 +02:00 committed by Simon Hausmann
parent 2a71d0e938
commit 84ec47743d
1 changed files with 3 additions and 14 deletions

View File

@ -2349,27 +2349,16 @@ void tst_QJSEngine::jsFutureReservedWords()
QCOMPARE(!ret.isError(), allowed);
}
{
// this should probably be allowed (see task 162567)
QJSEngine eng;
QJSValue ret = eng.evaluate("o = {}; o." + word + " = 123");
QEXPECT_FAIL("class", "QTBUG-27193", Abort);
QEXPECT_FAIL("const", "QTBUG-27193", Abort);
QEXPECT_FAIL("debugger", "QTBUG-27193", Abort);
QEXPECT_FAIL("enum", "QTBUG-27193", Abort);
QEXPECT_FAIL("export", "QTBUG-27193", Abort);
QEXPECT_FAIL("extends", "QTBUG-27193", Abort);
QEXPECT_FAIL("import", "QTBUG-27193", Abort);
QEXPECT_FAIL("super", "QTBUG-27193", Abort);
QCOMPARE(ret.isNumber(), allowed);
QCOMPARE(!ret.isError(), allowed);
QCOMPARE(ret.isNumber(), true);
QCOMPARE(!ret.isError(), true);
}
{
// this should probably be allowed (see task 162567)
QJSEngine eng;
QJSValue ret = eng.evaluate("o = { " + word + ": 123 }");
QCOMPARE(!ret.isError(), allowed);
QCOMPARE(!ret.isError(), true);
}
}