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
621180e8
Commit
621180e8
authored
May 03, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
May 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Better handling of to_integer result in String.charCodeAt.
parent
0143201e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
string.c
dlls/jscript/string.c
+7
-3
api.js
dlls/jscript/tests/api.js
+2
-0
No files found.
dlls/jscript/string.c
View file @
621180e8
...
...
@@ -350,6 +350,7 @@ static HRESULT String_charCodeAt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
if
(
arg_cnt
(
dp
)
>
0
)
{
VARIANT
v
;
double
d
;
hres
=
to_integer
(
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
{
...
...
@@ -357,13 +358,16 @@ static HRESULT String_charCodeAt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
return
hres
;
}
if
(
V_VT
(
&
v
)
!=
VT_I4
||
V_I4
(
&
v
)
<
0
||
V_I4
(
&
v
)
>=
length
)
{
if
(
retv
)
num_set_nan
(
&
v
);
d
=
num_val
(
&
v
);
if
(
!
is_int32
(
d
)
||
d
<
0
||
d
>=
length
)
{
SysFreeString
(
val_str
);
if
(
retv
)
num_set_nan
(
retv
);
return
S_OK
;
}
idx
=
V_I4
(
&
v
)
;
idx
=
d
;
}
if
(
retv
)
{
...
...
dlls/jscript/tests/api.js
View file @
621180e8
...
...
@@ -329,6 +329,8 @@ tmp = "\052".charCodeAt(0);
ok
(
tmp
===
0x2A
,
"'
\
052'.charCodeAt(0) = "
+
tmp
);
tmp
=
"
\
xa2"
.
charCodeAt
(
0
);
ok
(
tmp
===
0xA2
,
"'
\
xa2'.charCodeAt(0) = "
+
tmp
);
tmp
=
"abc"
.
charCodeAt
(
bigInt
);
ok
(
isNaN
(
tmp
),
"'abc'.charCodeAt(bigInt) = "
+
tmp
);
tmp
=
"abcd"
.
substring
(
1
,
3
);
ok
(
tmp
===
"bc"
,
"'abcd'.substring(1,3) = "
+
tmp
);
...
...
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