Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c1cb8f29
Commit
c1cb8f29
authored
Apr 18, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Correctly handle empty matches in String.replace.
parent
e21588ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
string.c
dlls/jscript/string.c
+3
-0
regexp.js
dlls/jscript/tests/regexp.js
+9
-0
No files found.
dlls/jscript/string.c
View file @
c1cb8f29
...
...
@@ -868,6 +868,9 @@ static HRESULT String_replace(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
}
if
(
FAILED
(
hres
))
break
;
if
(
!
match
.
len
)
cp
++
;
}
else
{
match
.
str
=
strstrW
(
cp
,
match_str
);
if
(
!
match
.
str
)
...
...
dlls/jscript/tests/regexp.js
View file @
c1cb8f29
...
...
@@ -583,4 +583,13 @@ ok(i === null, "' undefined '.search() = " + i);
tmp
=
"=)"
.
replace
(
/=/
,
"?"
);
ok
(
tmp
===
"?)"
,
"'=)'.replace(/=/, '?') = "
+
tmp
);
tmp
=
" "
.
replace
(
/^
\s
*|
\s
*$/g
,
"y"
);
ok
(
tmp
===
"yy"
,
'" ".replace(/^
\
s*|
\
s*$/g, "y") = '
+
tmp
);
tmp
=
"xxx"
.
replace
(
/^
\s
*|
\s
*$/g
,
""
);
ok
(
tmp
===
"xxx"
,
'"xxx".replace(/^
\
s*|
\
s*$/g, "y") = '
+
tmp
);
tmp
=
"xxx"
.
replace
(
/^
\s
*|
\s
*$/g
,
"y"
);
ok
(
tmp
===
"yxxxy"
,
'"xxx".replace(/^
\
s*|
\
s*$/g, "y") = '
+
tmp
);
reportSuccess
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment