Jacek Caban : jscript: Don't unescape '\v'.
Module: wine Branch: master Commit: 48202ee09ea0ab7a93920252276e3bf8cc170888 URL: http://source.winehq.org/git/wine.git/?a=commit;h=48202ee09ea0ab7a9392025227... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Dec 29 16:01:56 2010 +0100 jscript: Don't unescape '\v'. --- dlls/jscript/lex.c | 3 --- dlls/jscript/tests/lang.js | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c index 0329fa4..723f0ef 100644 --- a/dlls/jscript/lex.c +++ b/dlls/jscript/lex.c @@ -266,9 +266,6 @@ static BOOL unescape(WCHAR *str) case 'n': c = '\n'; break; - case 'v': - c = '\v'; - break; case 'f': c = '\f'; break; diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index bdf039a..5a361d7 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -942,6 +942,30 @@ ok((Infinity != NaN) === true, "(Infinity != NaN) !== true"); ok((Infinity != NaN) === true, "(Infinity != NaN) !== true"); ok((0 == NaN) === false, "(0 === NaN) != false"); +// escape tests +var escapeTests = [ + ["\'", "\\'", 39], + ["\"", "\\\"", 34], + ["\\", "\\\\", 92], + ["\b", "\\b", 8], + ["\t", "\\t", 9], + ["\n", "\\n", 10], + ["\v", "\\v", 118], + ["\f", "\\f", 12], + ["\r", "\\r", 13], + ["\xf3", "\\xf3", 0xf3], + ["\u1234", "\\u1234", 0x1234], + ["\a", "\\a", 97], + ["\?", "\\?", 63] +]; + +for(i=0; i<escapeTests.length; i++) { + tmp = escapeTests[i][0].charCodeAt(0); + ok(tmp === escapeTests[i][2], "escaped '" + escapeTests[i][1] + "' = " + tmp + " expected " + escapeTests[i][2]); +} + +tmp = !+"\v1"; +ok(tmp === true, '!+"\v1" = ' + tmp); ok(typeof(testFunc2) === "function", "typeof(testFunc2) = " + typeof(testFunc2)); tmp = testFunc2(1);
participants (1)
-
Alexandre Julliard