diff options
Diffstat (limited to 'tests/auto/qml/qjsengine/tst_qjsengine.cpp')
-rw-r--r-- | tests/auto/qml/qjsengine/tst_qjsengine.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 55c3fc800a..70b718c4d8 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -2226,15 +2226,10 @@ void tst_QJSEngine::jsContinueInSwitch() void tst_QJSEngine::jsShadowReadOnlyPrototypeProperty() { - // SpiderMonkey has different behavior than JSC and V8; it disallows - // creating a property on the instance if there's a property with the - // same name in the prototype, and that property is read-only. We - // adopted that behavior in the old (4.5) QtScript back-end, but it - // just seems weird -- and non-compliant. Adopt the JSC behavior instead. QJSEngine eng; QVERIFY(eng.evaluate("o = {}; o.__proto__ = parseInt; o.length").isNumber()); - QCOMPARE(eng.evaluate("o.length = 123; o.length").toInt(), 123); - QVERIFY(eng.evaluate("o.hasOwnProperty('length')").toBool()); + QVERIFY(eng.evaluate("o.length = 123; o.length").toInt() != 123); + QVERIFY(!eng.evaluate("o.hasOwnProperty('length')").toBool()); } void tst_QJSEngine::jsReservedWords_data() |