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
f96aa1f3
Commit
f96aa1f3
authored
Apr 11, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Properly support overloaded values in to_int32.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c06d362b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
jsutils.c
dlls/jscript/jsutils.c
+8
-1
lang.js
dlls/jscript/tests/lang.js
+6
-0
No files found.
dlls/jscript/jsutils.c
View file @
f96aa1f3
...
...
@@ -659,11 +659,18 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, INT *ret)
double
n
;
HRESULT
hres
;
const
double
p32
=
(
double
)
0xffffffff
+
1
;
hres
=
to_number
(
ctx
,
v
,
&
n
);
if
(
FAILED
(
hres
))
return
hres
;
*
ret
=
is_finite
(
n
)
?
n
:
0
;
if
(
is_finite
(
n
))
n
=
n
>
0
?
fmod
(
n
,
p32
)
:
-
fmod
(
-
n
,
p32
);
else
n
=
0
;
*
ret
=
(
UINT32
)
n
;
return
S_OK
;
}
...
...
dlls/jscript/tests/lang.js
View file @
f96aa1f3
...
...
@@ -632,6 +632,12 @@ tmp = 10;
ok
((
tmp
|=
0x10
)
===
26
,
"tmp(10) |= 0x10 !== 26"
);
ok
(
getVT
(
tmp
)
===
"VT_I4"
,
"getVT(tmp |= 10) = "
+
getVT
(
tmp
));
tmp
=
(
123
*
Math
.
pow
(
2
,
32
)
+
2
)
|
0
;
ok
(
tmp
===
2
,
"123*2^32+2 | 0 = "
+
tmp
);
tmp
=
(
-
123
*
Math
.
pow
(
2
,
32
)
+
2
)
|
0
;
ok
(
tmp
===
2
,
"123*2^32+2 | 0 = "
+
tmp
);
tmp
=
3
&
5
;
ok
(
tmp
===
1
,
"3 & 5 !== 1"
);
ok
(
getVT
(
tmp
)
===
"VT_I4"
,
"getVT(3|5) = "
+
getVT
(
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