summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp17
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp6
2 files changed, 17 insertions, 6 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index b52051f..768fe3c 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -2723,6 +2723,14 @@ void tst_QScriptEngine::errorConstructors()
}
}
+static QScriptValue argumentsProperty_fun(QScriptContext *, QScriptEngine *eng)
+{
+ eng->evaluate("var a = arguments[0];");
+ eng->evaluate("arguments[0] = 200;");
+ return eng->evaluate("a + arguments[0]");
+}
+
+
void tst_QScriptEngine::argumentsProperty()
{
{
@@ -2751,6 +2759,15 @@ void tst_QScriptEngine::argumentsProperty()
QEXPECT_FAIL("", "", Continue);
QVERIFY(eng.evaluate("arguments").isUndefined());
}
+
+ {
+ QScriptEngine eng;
+ QScriptValue fun = eng.newFunction(argumentsProperty_fun);
+ eng.globalObject().setProperty("fun", eng.newFunction(argumentsProperty_fun));
+ QScriptValue result = eng.evaluate("fun(18)");
+ QVERIFY(result.isNumber());
+ QCOMPARE(result.toInt32(), 218);
+ }
}
void tst_QScriptEngine::numberClass()
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index f272b7f..c0200a3 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2383,11 +2383,8 @@ void tst_QScriptValue::call()
QScriptValueList args;
args << QScriptValue(&eng, 123.0);
QScriptValue result = fun.call(eng.undefinedValue(), args);
- QEXPECT_FAIL("", "hasUncaughtException() should return false", Continue);
QVERIFY(!eng.hasUncaughtException());
- QEXPECT_FAIL("", "Need to create arguments object for frame", Continue);
QCOMPARE(result.isNumber(), true);
- QEXPECT_FAIL("", "Need to create arguments object for frame", Continue);
QCOMPARE(result.toNumber(), 123.0);
}
}
@@ -2402,7 +2399,6 @@ void tst_QScriptValue::call()
QScriptValueList args;
args << QScriptValue();
QScriptValue ret = fun.call(QScriptValue(), args);
- QEXPECT_FAIL("", "hasUncaughtException() should return false", Continue);
QVERIFY(!eng.hasUncaughtException());
QCOMPARE(ret.isValid(), true);
QCOMPARE(ret.isUndefined(), true);
@@ -2415,7 +2411,6 @@ void tst_QScriptValue::call()
args << QScriptValue();
QScriptValue ret = fun.call(QScriptValue(), args);
QCOMPARE(ret.isValid(), true);
- QEXPECT_FAIL("", "Need to create arguments object for frame", Continue);
QCOMPARE(ret.isUndefined(), true);
}
}
@@ -2426,7 +2421,6 @@ void tst_QScriptValue::call()
args << QScriptValue() << QScriptValue();
QScriptValue ret = fun.call(QScriptValue(), args);
QCOMPARE(ret.isValid(), true);
- QEXPECT_FAIL("", "Need to create arguments object for frame", Continue);
QCOMPARE(ret.isNumber(), true);
QCOMPARE(qIsNaN(ret.toNumber()), true);
}