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
a3f7f0f7
Commit
a3f7f0f7
authored
Sep 17, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Store regexp last_index value as jsval.
parent
228aab23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
regexp.c
dlls/jscript/regexp.c
+7
-7
No files found.
dlls/jscript/regexp.c
View file @
a3f7f0f7
...
...
@@ -84,7 +84,7 @@ typedef struct {
JSRegExp
*
jsregexp
;
BSTR
str
;
INT
last_index
;
VARIANT
last_index_var
;
jsval_t
last_index_val
;
}
RegExpInstance
;
static
const
WCHAR
sourceW
[]
=
{
's'
,
'o'
,
'u'
,
'r'
,
'c'
,
'e'
,
0
};
...
...
@@ -3308,8 +3308,8 @@ static inline RegExpInstance *regexp_from_vdisp(vdisp_t *vdisp)
static
void
set_last_index
(
RegExpInstance
*
This
,
DWORD
last_index
)
{
This
->
last_index
=
last_index
;
VariantClear
(
&
This
->
last_index_var
);
num_set_val
(
&
This
->
last_index_var
,
last_index
);
jsval_release
(
This
->
last_index_val
);
This
->
last_index_val
=
jsval_number
(
last_index
);
}
static
HRESULT
do_regexp_match_next
(
script_ctx_t
*
ctx
,
RegExpInstance
*
regexp
,
DWORD
rem_flags
,
...
...
@@ -3542,13 +3542,13 @@ static HRESULT RegExp_lastIndex(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
case
DISPATCH_PROPERTYGET
:
{
RegExpInstance
*
regexp
=
regexp_from_vdisp
(
jsthis
);
return
variant_to_jsval
(
&
regexp
->
last_index_var
,
r
);
return
jsval_copy
(
regexp
->
last_index_val
,
r
);
}
case
DISPATCH_PROPERTYPUT
:
{
RegExpInstance
*
regexp
=
regexp_from_vdisp
(
jsthis
);
HRESULT
hres
;
hres
=
jsval_
to_variant
(
argv
[
0
],
&
regexp
->
last_index_var
);
hres
=
jsval_
copy
(
argv
[
0
],
&
regexp
->
last_index_val
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -3765,7 +3765,7 @@ static void RegExp_destructor(jsdisp_t *dispex)
if
(
This
->
jsregexp
)
js_DestroyRegExp
(
This
->
jsregexp
);
VariantClear
(
&
This
->
last_index_var
);
jsval_release
(
This
->
last_index_val
);
SysFreeString
(
This
->
str
);
heap_free
(
This
);
}
...
...
@@ -3857,7 +3857,7 @@ HRESULT create_regexp(script_ctx_t *ctx, const WCHAR *exp, int len, DWORD flags,
return
E_FAIL
;
}
num_set_int
(
&
regexp
->
last_index_var
,
0
);
regexp
->
last_index_val
=
jsval_number
(
0
);
*
ret
=
&
regexp
->
dispex
;
return
S_OK
;
...
...
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