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
fe0bd340
Commit
fe0bd340
authored
Jun 05, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Support passing non-string flags to RegExp constructor.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4e887493
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
jsregexp.c
dlls/jscript/jsregexp.c
+10
-14
regexp.js
dlls/jscript/tests/regexp.js
+12
-0
No files found.
dlls/jscript/jsregexp.c
View file @
fe0bd340
...
...
@@ -671,7 +671,7 @@ HRESULT create_regexp(script_ctx_t *ctx, jsstr_t *src, DWORD flags, jsdisp_t **r
HRESULT
create_regexp_var
(
script_ctx_t
*
ctx
,
jsval_t
src_arg
,
jsval_t
*
flags_arg
,
jsdisp_t
**
ret
)
{
unsigned
flags
,
opt_len
=
0
;
unsigned
flags
=
0
;
const
WCHAR
*
opt
=
NULL
;
jsstr_t
*
src
;
HRESULT
hres
=
S_OK
;
...
...
@@ -700,24 +700,20 @@ HRESULT create_regexp_var(script_ctx_t *ctx, jsval_t src_arg, jsval_t *flags_arg
if
(
FAILED
(
hres
))
return
hres
;
if
(
flags_arg
)
{
if
(
flags_arg
&&
!
is_undefined
(
*
flags_arg
)
)
{
jsstr_t
*
opt_str
;
if
(
!
is_string
(
*
flags_arg
))
{
FIXME
(
"unimplemented for %s
\n
"
,
debugstr_jsval
(
*
flags_arg
));
return
E_NOTIMPL
;
}
opt_str
=
get_string
(
*
flags_arg
);
opt
=
jsstr_flatten
(
opt_str
);
if
(
!
opt
)
{
jsstr_release
(
src
);
return
E_OUTOFMEMORY
;
hres
=
to_string
(
ctx
,
*
flags_arg
,
&
opt_str
);
if
(
SUCCEEDED
(
hres
))
{
opt
=
jsstr_flatten
(
opt_str
);
if
(
opt
)
hres
=
parse_regexp_flags
(
opt
,
jsstr_length
(
opt_str
),
&
flags
);
else
hres
=
E_OUTOFMEMORY
;
jsstr_release
(
opt_str
);
}
opt_len
=
jsstr_length
(
opt_str
);
}
hres
=
parse_regexp_flags
(
opt
,
opt_len
,
&
flags
);
if
(
SUCCEEDED
(
hres
))
hres
=
create_regexp
(
ctx
,
src
,
flags
,
ret
);
jsstr_release
(
src
);
...
...
dlls/jscript/tests/regexp.js
View file @
fe0bd340
...
...
@@ -701,4 +701,16 @@ ok(re.ignoreCase === false, "re.ignoreCase = " + re.ignoreCase);
ok
(
re
.
multiline
===
false
,
"re.multiline = "
+
re
.
multiline
);
ok
(
re
.
global
===
false
,
"re.global = "
+
re
.
global
);
re
=
new
RegExp
(
"test"
,
undefined
);
ok
(
re
.
source
===
"test"
,
"re.source = "
+
re
.
source
);
ok
(
re
.
ignoreCase
===
false
,
"re.ignoreCase = "
+
re
.
ignoreCase
);
ok
(
re
.
multiline
===
false
,
"re.multiline = "
+
re
.
multiline
);
ok
(
re
.
global
===
false
,
"re.global = "
+
re
.
global
);
re
=
new
RegExp
(
"test"
,
{
toString
:
function
()
{
return
"mg"
;
}
});
ok
(
re
.
source
===
"test"
,
"re.source = "
+
re
.
source
);
ok
(
re
.
ignoreCase
===
false
,
"re.ignoreCase = "
+
re
.
ignoreCase
);
ok
(
re
.
multiline
===
true
,
"re.multiline = "
+
re
.
multiline
);
ok
(
re
.
global
===
true
,
"re.global = "
+
re
.
global
);
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