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
ece2654e
Commit
ece2654e
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: Fix Date_setMinutes implementation.
parent
bbfab68b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
3 deletions
+74
-3
date.c
dlls/jscript/date.c
+74
-3
No files found.
dlls/jscript/date.c
View file @
ece2654e
...
...
@@ -1054,6 +1054,7 @@ static HRESULT Date_setMinutes(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
VARIANT
v
;
HRESULT
hres
;
DateInstance
*
date
;
DOUBLE
t
,
min
,
sec
,
ms
;
TRACE
(
"
\n
"
);
...
...
@@ -1068,12 +1069,33 @@ static HRESULT Date_setMinutes(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
return
S_OK
;
}
date
=
(
DateInstance
*
)
dispex
;
t
=
local_time
(
date
->
time
,
date
);
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
min
=
num_val
(
&
v
);
date
=
(
DateInstance
*
)
dispex
;
date
->
time
=
time_clip
(
date
->
time
-
(
min_from_time
(
date
->
time
)
-
num_val
(
&
v
))
*
MS_PER_MINUTE
);
if
(
arg_cnt
(
dp
)
>
1
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
1
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
sec
=
num_val
(
&
v
);
}
else
sec
=
sec_from_time
(
t
);
if
(
arg_cnt
(
dp
)
>
2
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
2
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
ms
=
num_val
(
&
v
);
}
else
ms
=
ms_from_time
(
t
);
t
=
make_date
(
day
(
t
),
make_time
(
hour_from_time
(
t
),
min
,
sec
,
ms
));
date
->
time
=
time_clip
(
utc
(
t
,
date
));
if
(
retv
)
num_set_val
(
retv
,
date
->
time
);
...
...
@@ -1085,7 +1107,56 @@ static HRESULT Date_setMinutes(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
static
HRESULT
Date_setUTCMinutes
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
return
Date_setMinutes
(
dispex
,
lcid
,
flags
,
dp
,
retv
,
ei
,
caller
);
VARIANT
v
;
HRESULT
hres
;
DateInstance
*
date
;
DOUBLE
t
,
min
,
sec
,
ms
;
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
;
}
date
=
(
DateInstance
*
)
dispex
;
t
=
date
->
time
;
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
min
=
num_val
(
&
v
);
if
(
arg_cnt
(
dp
)
>
1
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
1
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
sec
=
num_val
(
&
v
);
}
else
sec
=
sec_from_time
(
t
);
if
(
arg_cnt
(
dp
)
>
2
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
2
),
ei
,
&
v
);
if
(
FAILED
(
hres
))
return
hres
;
ms
=
num_val
(
&
v
);
}
else
ms
=
ms_from_time
(
t
);
t
=
make_date
(
day
(
t
),
make_time
(
hour_from_time
(
t
),
min
,
sec
,
ms
));
date
->
time
=
time_clip
(
t
);
if
(
retv
)
num_set_val
(
retv
,
date
->
time
);
return
S_OK
;
}
/* ECMA-262 3rd Edition 15.9.5.35 */
...
...
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