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
0e8bcbd9
Commit
0e8bcbd9
authored
Dec 11, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added Math.PI implementation.
parent
f82df0ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
math.c
dlls/jscript/math.c
+18
-2
api.js
dlls/jscript/tests/api.js
+5
-0
No files found.
dlls/jscript/math.c
View file @
0e8bcbd9
...
...
@@ -54,6 +54,21 @@ static const WCHAR sinW[] = {'s','i','n',0};
static
const
WCHAR
sqrtW
[]
=
{
's'
,
'q'
,
'r'
,
't'
,
0
};
static
const
WCHAR
tanW
[]
=
{
't'
,
'a'
,
'n'
,
0
};
static
HRESULT
math_constant
(
DOUBLE
val
,
WORD
flags
,
VARIANT
*
retv
)
{
switch
(
flags
)
{
case
DISPATCH_PROPERTYGET
:
V_VT
(
retv
)
=
VT_R8
;
V_R8
(
retv
)
=
val
;
return
S_OK
;
case
DISPATCH_PROPERTYPUT
:
return
S_OK
;
}
FIXME
(
"unhandled flags %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
static
HRESULT
Math_E
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
...
...
@@ -89,11 +104,12 @@ static HRESULT Math_LN10(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *
return
E_NOTIMPL
;
}
/* ECMA-262 3rd Edition 15.8.1.6 */
static
HRESULT
Math_PI
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXM
E
(
"
\n
"
);
return
E_NOTIMPL
;
TRAC
E
(
"
\n
"
);
return
math_constant
(
M_PI
,
flags
,
retv
)
;
}
static
HRESULT
Math_SQRT2
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
dlls/jscript/tests/api.js
View file @
0e8bcbd9
...
...
@@ -609,4 +609,9 @@ date = new Date(100);
ok
(
date
.
getTime
()
===
100
,
"date.getTime() = "
+
date
.
getTime
());
ok
(
Date
.
prototype
.
getTime
()
===
0
,
"date.prototype.getTime() = "
+
Date
.
prototype
.
getTime
());
ok
(
typeof
(
Math
.
PI
)
===
"number"
,
"typeof(Math.PI) = "
+
typeof
(
Math
.
PI
));
ok
(
Math
.
floor
(
Math
.
PI
*
100
)
===
314
,
"Math.PI = "
+
Math
.
PI
);
Math
.
PI
=
"test"
;
ok
(
Math
.
floor
(
Math
.
PI
*
100
)
===
314
,
"modified Math.PI = "
+
Math
.
PI
);
reportSuccess
();
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