diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2010-02-11 10:55:52 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2010-03-10 09:19:43 (GMT) |
commit | d73e11d56a094544f036fac3f6e4483d1104261e (patch) | |
tree | c292c8f53c660dae3f7681dc7acbbe788730a580 /tests | |
parent | 20e2b87b5194abf7e9f08b7c42c030a57e2d6b28 (diff) | |
download | Qt-d73e11d56a094544f036fac3f6e4483d1104261e.zip Qt-d73e11d56a094544f036fac3f6e4483d1104261e.tar.gz Qt-d73e11d56a094544f036fac3f6e4483d1104261e.tar.bz2 |
Update src/3rdparty/javascriptcore and adapt src/script to the changes
- Update qscriptvalueiterator test to expect length property when
iterating arrays and strings.
- Use EvalExecutable::create() instead of EvalExecutable constructor.
The constructor is private.
- Reimplement getOwnPropertyDescriptor() in all custom script objects.
- Remove all reimplementations of getPropertyAttributes().
It doesn't exist in trunk anymore (getOwnPropertyDescriptor() is used
instead).
- Remove checkDontDelete argument from deleteProperty() reimplementations.
The purpose of this argument was to support deleting properties
with attribute Undeletable from C++. But it was quite an invasive
patch to JavaScriptCore, and it doesn't seem worth it. If this feature
is really crucial it should be re-done upstream.
One of the tests needed to be updated so it's not sensitive to the
C++ undeletability.
- Adapt getOwnPropertyNames() reimplementations to signature change.
- Add missing QScriptObject structure flags, otherwise we don't get all virtual calls.
- Remove our patch for reporting column numbers in the debugger callbacks.
It was just too intrusive. As with the checkDontDelete issue, this should
be redone upstream if it's really important. In 4.7, QScriptEngineAgent
will always report a column number of 1.
Other compilation fixes:
- InternalFunction::name() takes an ExecState* argument, not GlobalData*
- ScopeChain::globalObject is no longer a function but a member variable
- ScopeChainNode constructor takes a GlobalObject argument
- Heap::collect() is called collectAllGarbage()
- JSValue::strictEqual() takes an ExecState* argument
- Debugger::exception() takes a bool hasHandler argument
- Debugger no longer reports column number (we decided to drop that patch from JSC)
- UString doesn't have operator+=(char*)
- Update the autotests to reflect the columnNumber=1 change.
- Add helper class to avoid crashing inside JSC.
Ever since r52856 in WebKit trunk, this is needed. There are probably a lot of
other public API functions that need this guard as well, but I'll add them as they
are discovered.
- Update mkdist-javascriptcore tag, exclude a few more files.
- Set ENABLE_JSC_MULTIPLE_THREADS=0 define on Mac due to r52355 in trunk.
Reviewed-by: Simon Hausmann
Diffstat (limited to 'tests')
4 files changed, 48 insertions, 7 deletions
diff --git a/tests/auto/qscriptclass/tst_qscriptclass.cpp b/tests/auto/qscriptclass/tst_qscriptclass.cpp index 41c674c..aca33ce 100644 --- a/tests/auto/qscriptclass/tst_qscriptclass.cpp +++ b/tests/auto/qscriptclass/tst_qscriptclass.cpp @@ -688,6 +688,7 @@ void tst_QScriptClass::getAndSetProperty() QCOMPARE(obj1.propertyFlags(foo2), foo2Pflags); QVERIFY(cls.lastQueryPropertyObject().strictlyEquals(obj1)); QVERIFY(cls.lastQueryPropertyName() == foo2); + QEXPECT_FAIL("", "classObject.getOwnPropertyDescriptor() reads the property value", Continue); QVERIFY(!cls.lastPropertyObject().isValid()); QVERIFY(cls.lastPropertyFlagsObject().strictlyEquals(obj1)); QVERIFY(cls.lastPropertyFlagsName() == foo2); diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index ac9ca46..a0f10dd 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -1245,6 +1245,7 @@ void tst_QScriptEngineAgent::positionChange_1() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, lineNumber); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 8); // 5 + 6 @@ -1279,6 +1280,7 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QVERIFY(spy->at(1).scriptId != spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, lineNumber); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 18); } @@ -1297,6 +1299,7 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 11); } @@ -1327,12 +1330,14 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 31); // void(i) QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(2).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(2).columnNumber, 31); } @@ -1351,18 +1356,21 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 12); // ++i QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(2).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(2).columnNumber, 28); // ++i QCOMPARE(spy->at(3).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(3).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(3).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(3).columnNumber, 28); } @@ -1381,24 +1389,28 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 12); // ++i QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(2).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(2).columnNumber, 17); // do QCOMPARE(spy->at(3).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(3).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(3).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(3).columnNumber, 12); // ++i QCOMPARE(spy->at(4).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(4).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(4).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(4).columnNumber, 17); } @@ -1429,6 +1441,7 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 15); } @@ -1447,12 +1460,14 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 32); // continue QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(2).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(2).columnNumber, 32); } @@ -1495,6 +1510,7 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 31); } @@ -1513,12 +1529,14 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 38); // break QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(2).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(2).columnNumber, 45); } @@ -1543,18 +1561,21 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange); QVERIFY(spy->at(0).scriptId != -1); QCOMPARE(spy->at(0).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(0).columnNumber, 7); // i = e QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 29); // i = 2 QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(2).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(2).columnNumber, 48); } @@ -1567,12 +1588,14 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange); QVERIFY(spy->at(0).scriptId != -1); QCOMPARE(spy->at(0).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(0).columnNumber, 7); // i = 3 QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 46); } @@ -1594,6 +1617,7 @@ void tst_QScriptEngineAgent::positionChange_2() QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); QCOMPARE(spy->at(1).lineNumber, 1); + QEXPECT_FAIL("", "With JSC-based back-end, column number is always reported as 1", Continue); QCOMPARE(spy->at(1).columnNumber, 20); } delete spy; diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index f83cf58..5b79340 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -2047,7 +2047,9 @@ void tst_QScriptValue::getSetProperty() } // should still be deletable from C++ object.setProperty("undeletableProperty", QScriptValue()); + QEXPECT_FAIL("", "With JSC-based back-end, undeletable properties can't be deleted from C++", Continue); QVERIFY(!object.property("undeletableProperty").isValid()); + QEXPECT_FAIL("", "With JSC-based back-end, undeletable properties can't be deleted from C++", Continue); QCOMPARE(object.propertyFlags("undeletableProperty"), 0); // SkipInEnumeration @@ -2082,11 +2084,11 @@ void tst_QScriptValue::getSetProperty() object.setProperty("flagProperty", str, QScriptValue::ReadOnly); QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly); - object.setProperty("flagProperty", str, object.propertyFlags("flagProperty") | QScriptValue::Undeletable); - QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly | QScriptValue::Undeletable); + object.setProperty("flagProperty", str, object.propertyFlags("flagProperty") | QScriptValue::SkipInEnumeration); + QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly | QScriptValue::SkipInEnumeration); object.setProperty("flagProperty", str, QScriptValue::KeepExistingFlags); - QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly | QScriptValue::Undeletable); + QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::ReadOnly | QScriptValue::SkipInEnumeration); object.setProperty("flagProperty", str, QScriptValue::UserRange); QCOMPARE(object.propertyFlags("flagProperty"), QScriptValue::UserRange); diff --git a/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp b/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp index 5ca7a3d..55773f0 100644 --- a/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp +++ b/tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp @@ -255,8 +255,14 @@ void tst_QScriptValueIterator::iterateArray() QVERIFY(it.value().strictlyEquals(array.property(propertyNames.at(i)))); QCOMPARE(it.value().toString(), propertyValues.at(i)); } - QCOMPARE(it.hasNext(), false); + QVERIFY(it.hasNext()); + it.next(); + QCOMPARE(it.name(), QString::fromLatin1("length")); + QVERIFY(it.value().isNumber()); + QCOMPARE(it.value().toInt32(), length); + QCOMPARE(it.flags(), QScriptValue::SkipInEnumeration | QScriptValue::Undeletable); + it.previous(); QCOMPARE(it.hasPrevious(), length > 0); for (int i = length - 1; i >= 0; --i) { it.previous(); @@ -301,7 +307,9 @@ void tst_QScriptValueIterator::iterateArray() QVERIFY(it.value().strictlyEquals(array.property(propertyNames.at(i)))); QCOMPARE(it.value().toString(), propertyValues.at(i)); } - QCOMPARE(it.hasNext(), false); + QCOMPARE(it.hasNext(), true); + it.next(); + QCOMPARE(it.name(), QString::fromLatin1("length")); } } @@ -420,9 +428,15 @@ void tst_QScriptValueIterator::iterateString() QCOMPARE(it.flags(), obj.propertyFlags(indexStr)); QCOMPARE(it.value().strictlyEquals(obj.property(indexStr)), true); } - QCOMPARE(it.hasNext(), false); + QVERIFY(it.hasNext()); + it.next(); + QCOMPARE(it.name(), QString::fromLatin1("length")); + QVERIFY(it.value().isNumber()); + QCOMPARE(it.value().toInt32(), length); + QCOMPARE(it.flags(), QScriptValue::ReadOnly | QScriptValue::SkipInEnumeration | QScriptValue::Undeletable); - QVERIFY(it.hasPrevious()); + it.previous(); + QCOMPARE(it.hasPrevious(), length > 0); for (int i = length - 1; i >= 0; --i) { it.previous(); QString indexStr = QScriptValue(&engine, i).toString(); |