Jacek Caban : jscript: Fixed parsing /=/ regexp.

Alexandre Julliard julliard at winehq.org
Mon Apr 2 13:14:51 CDT 2012


Module: wine
Branch: master
Commit: 114a439fed9f4fadc8a5a3ab27af869297f2321c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=114a439fed9f4fadc8a5a3ab27af869297f2321c

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Apr  2 13:46:11 2012 +0200

jscript: Fixed parsing /=/ regexp.

---

 dlls/jscript/lex.c           |    3 +--
 dlls/jscript/tests/regexp.js |    3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c
index dcdb3f3..4cf4d41 100644
--- a/dlls/jscript/lex.c
+++ b/dlls/jscript/lex.c
@@ -963,8 +963,7 @@ literal_t *parse_regexp(parser_ctx_t *ctx)
 
     TRACE("\n");
 
-    while(*ctx->ptr != '/')
-        ctx->ptr--;
+    while(*--ctx->ptr != '/');
 
     re = ++ctx->ptr;
     while(ctx->ptr < ctx->end && *ctx->ptr != '/') {
diff --git a/dlls/jscript/tests/regexp.js b/dlls/jscript/tests/regexp.js
index e9f26ef..c7f9363 100644
--- a/dlls/jscript/tests/regexp.js
+++ b/dlls/jscript/tests/regexp.js
@@ -580,4 +580,7 @@ ok(i === 1, "String.prototype.seatch.apply(obj, 'b') = " + i);
 i = " undefined ".search();
 ok(i === null, "' undefined '.search() = " + i);
 
+tmp = "=)".replace(/=/, "?");
+ok(tmp === "?)", "'=)'.replace(/=/, '?') = " + tmp);
+
 reportSuccess();




More information about the wine-cvs mailing list