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
8612ae88
Commit
8612ae88
authored
Sep 21, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added String.charCodeAt implementation.
parent
2c6847d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
string.c
dlls/jscript/string.c
+37
-2
api.js
dlls/jscript/tests/api.js
+13
-0
No files found.
dlls/jscript/string.c
View file @
8612ae88
...
...
@@ -199,11 +199,46 @@ static HRESULT String_charAt(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
return
S_OK
;
}
/* ECMA-262 3rd Edition 15.5.4.5 */
static
HRESULT
String_charCodeAt
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
const
WCHAR
*
str
;
DWORD
length
,
idx
=
0
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
if
(
dispex
->
builtin_info
->
class
==
JSCLASS_STRING
)
{
StringInstance
*
string
=
(
StringInstance
*
)
dispex
;
str
=
string
->
str
;
length
=
string
->
length
;
}
else
{
FIXME
(
"not string this not supported
\n
"
);
return
E_NOTIMPL
;
}
if
(
arg_cnt
(
dp
)
>
0
)
{
VARIANT
v
;
hres
=
to_integer
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
V_VT
(
&
v
)
!=
VT_I4
||
V_I4
(
&
v
)
<
0
||
V_I4
(
&
v
)
>=
length
)
{
FIXME
(
"NAN
\n
"
);
return
E_FAIL
;
}
idx
=
V_I4
(
&
v
);
}
if
(
retv
)
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
str
[
idx
];
}
return
S_OK
;
}
static
HRESULT
String_concat
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
dlls/jscript/tests/api.js
View file @
8612ae88
...
...
@@ -57,6 +57,19 @@ ok(tmp === "", "'abc',charAt(-1) = " + tmp);
tmp
=
"abc"
.
charAt
(
0
,
2
);
ok
(
tmp
===
"a"
,
"'abc',charAt(0.2) = "
+
tmp
);
tmp
=
"abc"
.
charCodeAt
(
0
);
ok
(
tmp
===
0x61
,
"'abc'.charCodeAt(0) = "
+
tmp
);
tmp
=
"abc"
.
charCodeAt
(
1
);
ok
(
tmp
===
0x62
,
"'abc'.charCodeAt(1) = "
+
tmp
);
tmp
=
"abc"
.
charCodeAt
(
2
);
ok
(
tmp
===
0x63
,
"'abc'.charCodeAt(2) = "
+
tmp
);
tmp
=
"abc"
.
charCodeAt
();
ok
(
tmp
===
0x61
,
"'abc'.charCodeAt() = "
+
tmp
);
tmp
=
"abc"
.
charCodeAt
(
true
);
ok
(
tmp
===
0x62
,
"'abc'.charCodeAt(true) = "
+
tmp
);
tmp
=
"abc"
.
charCodeAt
(
0
,
2
);
ok
(
tmp
===
0x61
,
"'abc'.charCodeAt(0,2) = "
+
tmp
);
tmp
=
"abcd"
.
substring
(
1
,
3
);
ok
(
tmp
===
"bc"
,
"'abcd'.substring(1,3) = "
+
tmp
);
tmp
=
"abcd"
.
substring
(
-
1
,
3
);
...
...
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