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
0b939338
Commit
0b939338
authored
Aug 27, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added RegExp.lastIndex implementation.
parent
a0d262c5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
regexp.c
dlls/jscript/regexp.c
+15
-1
regexp.js
dlls/jscript/tests/regexp.js
+4
-3
No files found.
dlls/jscript/regexp.c
View file @
0b939338
...
...
@@ -82,6 +82,7 @@ typedef struct {
JSRegExp
*
jsregexp
;
BSTR
str
;
DWORD
last_index
;
}
RegExpInstance
;
static
const
WCHAR
sourceW
[]
=
{
's'
,
'o'
,
'u'
,
'r'
,
'c'
,
'e'
,
0
};
...
...
@@ -3471,8 +3472,21 @@ static HRESULT RegExp_multiline(DispatchEx *dispex, LCID lcid, WORD flags, DISPP
static
HRESULT
RegExp_lastIndex
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
TRACE
(
"
\n
"
);
switch
(
flags
)
{
case
DISPATCH_PROPERTYGET
:
{
RegExpInstance
*
regexp
=
(
RegExpInstance
*
)
dispex
;
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
regexp
->
last_index
;
break
;
}
default:
FIXME
(
"unimplemented flags: %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
return
S_OK
;
}
static
HRESULT
RegExp_toString
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
dlls/jscript/tests/regexp.js
View file @
0b939338
...
...
@@ -17,7 +17,10 @@
*/
var
m
;
var
m
,
re
;
re
=
/a+/
;
ok
(
re
.
lastIndex
===
0
,
"re.lastIndex = "
+
re
.
lastIndex
);
m
=
"abcabc"
.
match
(
/ca/
);
ok
(
typeof
(
m
)
===
"object"
,
"typeof m is not object"
);
...
...
@@ -208,8 +211,6 @@ ok(r.length === 2, "r.length = " + r.length);
ok
(
r
[
0
]
===
"1"
,
"r[0] = "
+
r
[
0
]);
ok
(
r
[
1
]
===
"2"
,
"r[1] = "
+
r
[
1
]);
var
re
;
re
=
/abc
[^
d
]
/g
;
ok
(
re
.
source
===
"abc[^d]"
,
"re.source = '"
+
re
.
source
+
"', expected 'abc[^d]'"
);
...
...
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