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
37883a66
Commit
37883a66
authored
Jun 22, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Fixed Date_setMilliseconds implementation.
Previous implementation was not working when: utc_time != to_utc(to_local_time(utc_time))
parent
b45f01b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
date.c
dlls/jscript/date.c
+37
-2
api.js
dlls/jscript/tests/api.js
+2
-1
No files found.
dlls/jscript/date.c
View file @
37883a66
...
...
@@ -882,6 +882,7 @@ static HRESULT Date_setMilliseconds(DispatchEx *dispex, LCID lcid, WORD flags, D
VARIANT
v
;
HRESULT
hres
;
DateInstance
*
date
;
DOUBLE
t
;
TRACE
(
"
\n
"
);
...
...
@@ -901,7 +902,10 @@ static HRESULT Date_setMilliseconds(DispatchEx *dispex, LCID lcid, WORD flags, D
return
hres
;
date
=
(
DateInstance
*
)
dispex
;
date
->
time
=
time_clip
(
date
->
time
-
ms_from_time
(
date
->
time
)
+
num_val
(
&
v
));
t
=
local_time
(
date
->
time
,
date
);
t
=
make_date
(
day
(
t
),
make_time
(
hour_from_time
(
t
),
min_from_time
(
t
),
sec_from_time
(
t
),
num_val
(
&
v
)));
date
->
time
=
time_clip
(
utc
(
t
,
date
));
if
(
retv
)
num_set_val
(
retv
,
date
->
time
);
...
...
@@ -913,7 +917,38 @@ static HRESULT Date_setMilliseconds(DispatchEx *dispex, LCID lcid, WORD flags, D
static
HRESULT
Date_setUTCMilliseconds
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
return
Date_setMilliseconds
(
dispex
,
lcid
,
flags
,
dp
,
retv
,
ei
,
caller
);
VARIANT
v
;
HRESULT
hres
;
DateInstance
*
date
;
DOUBLE
t
;
TRACE
(
"
\n
"
);
if
(
!
is_class
(
dispex
,
JSCLASS_DATE
))
{
FIXME
(
"throw TypeError
\n
"
);
return
E_FAIL
;
}
if
(
!
arg_cnt
(
dp
))
{
FIXME
(
"throw ArgumentNotOptional
\n
"
);
if
(
retv
)
num_set_nan
(
retv
);
return
S_OK
;
}
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
date
=
(
DateInstance
*
)
dispex
;
t
=
date
->
time
;
t
=
make_date
(
day
(
t
),
make_time
(
hour_from_time
(
t
),
min_from_time
(
t
),
sec_from_time
(
t
),
num_val
(
&
v
)));
date
->
time
=
time_clip
(
t
);
if
(
retv
)
num_set_val
(
retv
,
date
->
time
);
return
S_OK
;
}
/* ECMA-262 3rd Edition 15.9.5.30 */
...
...
dlls/jscript/tests/api.js
View file @
37883a66
...
...
@@ -1003,7 +1003,8 @@ ok(isNaN(date.setMilliseconds(0)), "date.setMilliseconds() is not NaN");
date
.
setTime
(
0
);
date
.
setMilliseconds
(
-
10
,
2
);
ok
(
date
.
getUTCMilliseconds
()
===
990
,
"date.getUTCMilliseconds() = "
+
date
.
getUTCMilliseconds
());
ok
(
date
.
setMilliseconds
(
10
)
===
date
.
setUTCMilliseconds
(
10
),
"date.setUTCMilliseconds(10) !== date.setUTCMilliseconds(10)"
);
date
.
setUTCMilliseconds
(
10
);
ok
(
date
.
getUTCMilliseconds
()
===
10
,
"date.getUTCMilliseconds() = "
+
date
.
getUTCMilliseconds
());
date
.
setSeconds
(
-
10
);
ok
(
date
.
getUTCSeconds
()
===
50
,
"date.getUTCSeconds() = "
+
date
.
getUTCSeconds
());
ok
(
date
.
setSeconds
(
10
)
===
date
.
setUTCSeconds
(
10
),
"date.setUTCSeconds(10) !== date.setUTCSeconds(10)"
);
...
...
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