Jacek Caban : jscript: Better syntax error tests.
Alexandre Julliard
julliard at winehq.org
Tue Dec 28 10:48:21 CST 2010
Module: wine
Branch: master
Commit: aab8a1ba3ac72fe1295969589b720e8e4191447e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=aab8a1ba3ac72fe1295969589b720e8e4191447e
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Dec 28 15:04:40 2010 +0100
jscript: Better syntax error tests.
---
dlls/jscript/tests/api.js | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index e4dc7c4..4b9f160 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -1954,9 +1954,21 @@ testException(function() {new VBArray(new VBArray(createArray()));}, "E_NOT_VBAR
testException(function() {VBArray.prototype.lbound.call(new Object());}, "E_NOT_VBARRAY");
// SyntaxError tests
-function testSyntaxError(code, e) {
- testException(function() { eval(code); }, e);
+function testSyntaxError(code, id) {
+ var ex = exception_array[id];
+ var ret = "", num = "";
+
+ try {
+ eval(code);
+ } catch(e) {
+ ret = e.name;
+ num = e.number;
+ }
+
+ ok(ret === ex.type, "Syntax exception test, ret = " + ret + ", expected " + ex.type +". Executed code: " + code);
+ ok(num === ex.number, "Syntax exception test, num = " + num + ", expected " + ex.number + ". Executed code: " + code);
}
+
testSyntaxError("for(i=0;) {}", "E_SYNTAX_ERROR");
testSyntaxError("function {};", "E_LBRACKET");
testSyntaxError("if", "E_LBRACKET");
More information about the wine-cvs
mailing list