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
3523a1f2
Commit
3523a1f2
authored
Jun 16, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added Date_getUTCSeconds and Date_getSeconds implementation.
parent
a005865f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
4 deletions
+46
-4
date.c
dlls/jscript/date.c
+42
-4
api.js
dlls/jscript/tests/api.js
+4
-0
No files found.
dlls/jscript/date.c
View file @
3523a1f2
...
...
@@ -249,6 +249,20 @@ static inline DOUBLE min_from_time(DOUBLE time)
return
ret
;
}
/* ECMA-262 3th Edition 15.9.1.10 */
static
inline
DOUBLE
sec_from_time
(
DOUBLE
time
)
{
DOUBLE
ret
;
if
(
isnan
(
time
))
return
ret_nan
();
ret
=
fmod
(
floor
(
time
/
1000
),
60
);
if
(
ret
<
0
)
ret
+=
60
;
return
ret
;
}
/* ECMA-262 3rd Edition 15.9.1.14 */
static
inline
DOUBLE
time_clip
(
DOUBLE
time
)
{
...
...
@@ -582,18 +596,42 @@ static HRESULT Date_getUTCMinutes(DispatchEx *dispex, LCID lcid, WORD flags, DIS
return
S_OK
;
}
/* ECMA-262 3th Edition 15.9.1.10 */
static
HRESULT
Date_getSeconds
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
TRACE
(
"
\n
"
);
if
(
!
is_class
(
dispex
,
JSCLASS_DATE
))
{
FIXME
(
"throw TypeError
\n
"
);
return
E_FAIL
;
}
if
(
retv
)
{
DateInstance
*
date
=
(
DateInstance
*
)
dispex
;
DOUBLE
time
=
date
->
time
-
date
->
bias
*
MS_PER_MINUTE
;
num_set_val
(
retv
,
sec_from_time
(
time
));
}
return
S_OK
;
}
/* ECMA-262 3th Edition 15.9.1.10 */
static
HRESULT
Date_getUTCSeconds
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
TRACE
(
"
\n
"
);
if
(
!
is_class
(
dispex
,
JSCLASS_DATE
))
{
FIXME
(
"throw TypeError
\n
"
);
return
E_FAIL
;
}
if
(
retv
)
{
DateInstance
*
date
=
(
DateInstance
*
)
dispex
;
num_set_val
(
retv
,
sec_from_time
(
date
->
time
));
}
return
S_OK
;
}
static
HRESULT
Date_getMiliseconds
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
dlls/jscript/tests/api.js
View file @
3523a1f2
...
...
@@ -952,6 +952,7 @@ ok(date.getUTCDate() === 1, "date.getUTCDate() = " + date.getUTCDate());
ok
(
date
.
getUTCDay
()
===
4
,
"date.getUTCDay() = "
+
date
.
getUTCDay
());
ok
(
date
.
getUTCHours
()
===
0
,
"date.getUTCHours() = "
+
date
.
getUTCHours
());
ok
(
date
.
getUTCMinutes
()
===
0
,
"date.getUTCMinutes() = "
+
date
.
getUTCMinutes
());
ok
(
date
.
getUTCSeconds
()
===
0
,
"date.getUTCSeconds() = "
+
date
.
getUTCSeconds
());
date
.
setTime
(
60
*
24
*
60
*
60
*
1000
);
ok
(
date
.
getUTCFullYear
()
===
1970
,
"date.getUTCFullYear() = "
+
date
.
getUTCFullYear
());
ok
(
date
.
getUTCMonth
()
===
2
,
"date.getUTCMonth() = "
+
date
.
getUTCMonth
());
...
...
@@ -959,6 +960,7 @@ ok(date.getUTCDate() === 2, "date.getUTCDate() = " + date.getUTCDate());
ok
(
date
.
getUTCDay
()
===
1
,
"date.getUTCDay() = "
+
date
.
getUTCDay
());
ok
(
date
.
getUTCHours
()
===
0
,
"date.getUTCHours() = "
+
date
.
getUTCHours
());
ok
(
date
.
getUTCMinutes
()
===
0
,
"date.getUTCMinutes() = "
+
date
.
getUTCMinutes
());
ok
(
date
.
getUTCSeconds
()
===
0
,
"date.getUTCSeconds() = "
+
date
.
getUTCSeconds
());
date
.
setTime
(
59
*
24
*
60
*
60
*
1000
+
4
*
365
*
24
*
60
*
60
*
1000
+
60
*
60
*
1000
+
2
*
60
*
1000
+
2
*
1000
+
640
);
ok
(
date
.
getUTCFullYear
()
===
1974
,
"date.getUTCFullYear() = "
+
date
.
getUTCFullYear
());
ok
(
date
.
getUTCMonth
()
===
1
,
"date.getUTCMonth() = "
+
date
.
getUTCMonth
());
...
...
@@ -967,6 +969,7 @@ ok(date.getUTCDate() === 28, "date.getUTCDate() = " + date.getUTCDate());
ok
(
date
.
getUTCDay
()
===
4
,
"date.getUTCDay() = "
+
date
.
getUTCDay
());
ok
(
date
.
getUTCHours
()
===
1
,
"date.getUTCHours() = "
+
date
.
getUTCHours
());
ok
(
date
.
getUTCMinutes
()
===
2
,
"date.getUTCMinutes() = "
+
date
.
getUTCMinutes
());
ok
(
date
.
getUTCSeconds
()
===
2
,
"date.getUTCSeconds() = "
+
date
.
getUTCSeconds
());
date
.
setTime
(
Infinity
);
ok
(
isNaN
(
date
.
getUTCFullYear
()),
"date.getUTCFullYear() is not NaN"
);
ok
(
isNaN
(
date
.
getUTCMonth
()),
"date.getUTCMonth() is not NaN"
);
...
...
@@ -974,6 +977,7 @@ ok(isNaN(date.getUTCDate()), "date.getUTCDate() is not NaN");
ok
(
isNaN
(
date
.
getUTCDay
()),
"date.getUTCDay() is not NaN"
);
ok
(
isNaN
(
date
.
getUTCHours
()),
"date.getUTCHours() is not NaN"
);
ok
(
isNaN
(
date
.
getUTCMinutes
()),
"date.getUTCMinutes() is not NaN"
);
ok
(
isNaN
(
date
.
getUTCSeconds
()),
"date.getUTCSeconds() is not NaN"
);
ok
(
typeof
(
Math
.
PI
)
===
"number"
,
"typeof(Math.PI) = "
+
typeof
(
Math
.
PI
));
ok
(
Math
.
floor
(
Math
.
PI
*
100
)
===
314
,
"Math.PI = "
+
Math
.
PI
);
...
...
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