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
fe86330d
Commit
fe86330d
authored
May 26, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
May 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Treat no argument as "undefined" in RegExp.test.
parent
0acb7fb1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
regexp.c
dlls/jscript/regexp.c
+14
-1
regexp.js
dlls/jscript/tests/regexp.js
+6
-0
No files found.
dlls/jscript/regexp.c
View file @
fe86330d
...
...
@@ -101,6 +101,7 @@ static const WCHAR leftContextW[] =
static
const
WCHAR
rightContextW
[]
=
{
'r'
,
'i'
,
'g'
,
'h'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'e'
,
'x'
,
't'
,
0
};
static
const
WCHAR
undefinedW
[]
=
{
'u'
,
'n'
,
'd'
,
'e'
,
'f'
,
'i'
,
'n'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
/* FIXME: Better error handling */
...
...
@@ -3717,12 +3718,24 @@ static HRESULT RegExp_test(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPP
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
match_result_t
match
;
VARIANT
undef_var
;
VARIANT_BOOL
b
;
DWORD
argc
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
run_exec
(
ctx
,
jsthis
,
arg_cnt
(
dp
)
?
get_arg
(
dp
,
0
)
:
NULL
,
ei
,
NULL
,
&
match
,
NULL
,
NULL
,
&
b
);
argc
=
arg_cnt
(
dp
);
if
(
!
argc
)
{
V_VT
(
&
undef_var
)
=
VT_BSTR
;
V_BSTR
(
&
undef_var
)
=
SysAllocString
(
undefinedW
);
if
(
!
V_BSTR
(
&
undef_var
))
return
E_OUTOFMEMORY
;
}
hres
=
run_exec
(
ctx
,
jsthis
,
argc
?
get_arg
(
dp
,
0
)
:
&
undef_var
,
ei
,
NULL
,
&
match
,
NULL
,
NULL
,
&
b
);
if
(
!
argc
)
SysFreeString
(
V_BSTR
(
&
undef_var
));
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/tests/regexp.js
View file @
fe86330d
...
...
@@ -96,6 +96,12 @@ ok(m[1] === "test", "m[1] = " + m[1]);
b
=
/a*/
.
test
();
ok
(
b
===
true
,
"/a*/.test() returned "
+
b
);
b
=
/f/
.
test
();
ok
(
b
===
true
,
"/f/.test() returned "
+
b
);
b
=
/abc/
.
test
();
ok
(
b
===
false
,
"/abc/.test() returned "
+
b
);
m
=
"abcabc"
.
match
(
re
=
/ca/
);
ok
(
typeof
(
m
)
===
"object"
,
"typeof m is not object"
);
ok
(
m
.
length
===
1
,
"m.length is not 1"
);
...
...
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