Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
78fc648d
Commit
78fc648d
authored
Apr 09, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Replace only the first match for non-regexp pattern in String.replace.
parent
a37f74f5
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
api.js
dlls/jscript/tests/api.js
+9
-0
No files found.
dlls/jscript/string.c
View file @
78fc648d
...
...
@@ -961,6 +961,9 @@ static HRESULT String_replace(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
if
(
FAILED
(
hres
))
break
;
}
if
(
!
regexp
)
break
;
}
if
(
SUCCEEDED
(
hres
))
...
...
dlls/jscript/tests/api.js
View file @
78fc648d
...
...
@@ -414,6 +414,15 @@ ok(r === "-ret-", "r = " + r + " expected '-ret-'");
r
=
"-[test]-"
.
replace
(
"[test]"
,
replaceFunc3
,
"test"
);
ok
(
r
===
"-ret-"
,
"r = "
+
r
+
" expected '-ret-'"
);
r
=
"x,x,x"
.
replace
(
"x"
,
"y"
);
ok
(
r
===
"y,x,x"
,
"r = "
+
r
+
" expected 'y,x,x'"
);
r
=
"x,x,x"
.
replace
(
""
,
"y"
);
ok
(
r
===
"yx,x,x"
,
"r = "
+
r
+
" expected 'yx,x,x'"
);
r
=
"x,x,x"
.
replace
(
""
,
""
);
ok
(
r
===
"x,x,x"
,
"r = "
+
r
+
" expected 'x,x,x'"
);
r
=
"1,2,3"
.
split
(
","
);
ok
(
typeof
(
r
)
===
"object"
,
"typeof(r) = "
+
typeof
(
r
));
ok
(
r
.
length
===
3
,
"r.length = "
+
r
.
length
);
...
...
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