summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-05-25 16:23:40 +1000
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-05-25 16:23:40 +1000
commitb02bf4ef805e33a763d86ec8ff496a27fddc8ad8 (patch)
tree3a4b532176e4c59f13d8d4d6e42291b45eb0f179 /tests
parenta32987d32033a07e5a7440d7928cc8234db144bb (diff)
Revert "Reading/writing a non-existent property throws an exception"
This reverts commit 2b3e7706f4459569520c77b9fb3ff2bc006e60f1.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/eval.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/function.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp15
4 files changed, 8 insertions, 14 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
index faa510680a..bc2df98964 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/eval.qml
@@ -16,7 +16,7 @@ QtObject {
test1 = (eval("a") == 7);
test2 = (eval("b") == 9);
- try { eval("c") } catch(e) { test3 = true; }
+ test3 = (eval("c") == undefined);
test4 = (eval("console") == console);
test5 = (eval("Qt") == Qt);
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/function.qml b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
index e524189ca7..b435f5812e 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/function.qml
@@ -14,7 +14,6 @@ QtObject {
test1 = (func1(4) == 11);
test2 = (func2("Hello World!") == Qt.atob("Hello World!"));
-
- try { func3(); } catch(e) { test3 = true; }
+ test3 = (func3() == undefined);
}
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
index a20fc2855b..3ffdb339ad 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
@@ -2,5 +2,5 @@
function test(target)
{
- try { var a = target.a; } catch(e) {}
+ var a = target.a;
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index 217ed11883..e75abacc11 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -997,11 +997,11 @@ void tst_qdeclarativeecmascript::scriptErrors()
QString url = component.url().toString();
QString warning1 = url.left(url.length() - 3) + "js:2: Error: Invalid write to global property \"a\"";
- QString warning2 = url + ":5: Error: Cannot access non-existent property \"a\"";
+ QString warning2 = url + ":5: TypeError: Result of expression 'a' [undefined] is not an object.";
QString warning3 = url.left(url.length() - 3) + "js:4: Error: Invalid write to global property \"a\"";
- QString warning4 = url + ":10: Error: Cannot access non-existent property \"a\"";
- QString warning5 = url + ":8: Error: Cannot access non-existent property \"a\"";
- QString warning6 = url + ":7: Error: Cannot access non-existent property \"undefinedObject\"";
+ QString warning4 = url + ":10: TypeError: Result of expression 'a' [undefined] is not an object.";
+ QString warning5 = url + ":8: TypeError: Result of expression 'a' [undefined] is not an object.";
+ QString warning6 = url + ":7: Unable to assign [undefined] to int x";
QString warning7 = url + ":12: Error: Cannot assign to read-only property \"trueProperty\"";
QString warning8 = url + ":13: Error: Cannot assign to non-existent property \"fakeProperty\"";
@@ -1317,12 +1317,7 @@ void tst_qdeclarativeecmascript::callQtInvokables()
QDeclarativeEngine qmlengine;
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(&qmlengine);
QScriptEngine *engine = &ep->scriptEngine;
- QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(engine);
- scriptContext->pushScope(ep->globalClass->globalObject());
- QScriptValue scope = engine->newObject();
- scope.setProperty("object", ep->objectClass->newQObject(&o));
- scriptContext->setActivationObject(scope);
- scriptContext->pushScope(scope);
+ ep->globalClass->explicitSetProperty("object", ep->objectClass->newQObject(&o));
// Non-existent methods
o.reset();