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
60ddd438
Commit
60ddd438
authored
Jul 03, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added DateConstr_UTC implementation.
parent
41e297af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
69 deletions
+89
-69
date.c
dlls/jscript/date.c
+89
-69
No files found.
dlls/jscript/date.c
View file @
60ddd438
...
...
@@ -2210,8 +2210,92 @@ static HRESULT DateConstr_parse(DispatchEx *dispex, LCID lcid, WORD flags, DISPP
static
HRESULT
DateConstr_UTC
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
VARIANT
year
,
month
,
vdate
,
hours
,
minutes
,
seconds
,
ms
;
DOUBLE
y
;
int
arg_no
=
arg_cnt
(
dp
);
HRESULT
hres
;
TRACE
(
"
\n
"
);
if
(
arg_no
>
0
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
year
);
if
(
FAILED
(
hres
))
return
hres
;
y
=
num_val
(
&
year
);
if
(
0
<=
y
&&
y
<=
99
)
y
+=
1900
;
}
else
y
=
1900
;
if
(
arg_no
>
1
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
1
),
ei
,
&
month
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
month
)
=
VT_R8
;
V_R8
(
&
month
)
=
0
;
}
if
(
arg_no
>
2
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
2
),
ei
,
&
vdate
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
vdate
)
=
VT_R8
;
V_R8
(
&
vdate
)
=
1
;
}
if
(
arg_no
>
3
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
3
),
ei
,
&
hours
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
hours
)
=
VT_R8
;
V_R8
(
&
hours
)
=
0
;
}
if
(
arg_no
>
4
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
4
),
ei
,
&
minutes
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
minutes
)
=
VT_R8
;
V_R8
(
&
minutes
)
=
0
;
}
if
(
arg_no
>
5
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
5
),
ei
,
&
seconds
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
seconds
)
=
VT_R8
;
V_R8
(
&
seconds
)
=
0
;
}
if
(
arg_no
>
6
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
6
),
ei
,
&
ms
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
ms
)
=
VT_R8
;
V_R8
(
&
ms
)
=
0
;
}
if
(
retv
)
{
V_VT
(
retv
)
=
VT_R8
;
V_R8
(
retv
)
=
time_clip
(
make_date
(
make_day
(
y
,
num_val
(
&
month
),
num_val
(
&
vdate
)),
make_time
(
num_val
(
&
hours
),
num_val
(
&
minutes
),
num_val
(
&
seconds
),
num_val
(
&
ms
))));
}
return
S_OK
;
}
static
HRESULT
DateConstr_value
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
@@ -2266,76 +2350,12 @@ static HRESULT DateConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPP
/* ECMA-262 3rd Edition 15.9.3.1 */
default:
{
VARIANT
year
,
month
,
vdate
,
hours
,
minutes
,
seconds
,
ms
;
VARIANT
ret_date
;
DateInstance
*
di
;
int
arg_no
=
arg_cnt
(
dp
),
y
;
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
year
);
if
(
FAILED
(
hres
))
return
hres
;
y
=
num_val
(
&
year
);
if
(
0
<=
y
&&
y
<=
99
)
y
+=
1900
;
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
1
),
ei
,
&
month
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
arg_no
>
2
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
2
),
ei
,
&
vdate
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
vdate
)
=
VT_R8
;
V_R8
(
&
vdate
)
=
1
;
}
if
(
arg_no
>
3
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
3
),
ei
,
&
hours
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
hours
)
=
VT_R8
;
V_R8
(
&
hours
)
=
0
;
}
if
(
arg_no
>
4
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
4
),
ei
,
&
minutes
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
minutes
)
=
VT_R8
;
V_R8
(
&
minutes
)
=
0
;
}
if
(
arg_no
>
5
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
5
),
ei
,
&
seconds
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
seconds
)
=
VT_R8
;
V_R8
(
&
seconds
)
=
0
;
}
if
(
arg_no
>
6
)
{
hres
=
to_number
(
dispex
->
ctx
,
get_arg
(
dp
,
6
),
ei
,
&
ms
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
V_VT
(
&
ms
)
=
VT_R8
;
V_R8
(
&
ms
)
=
0
;
}
DateConstr_UTC
(
dispex
,
lcid
,
flags
,
dp
,
&
ret_date
,
ei
,
sp
);
hres
=
create_date
(
dispex
->
ctx
,
TRUE
,
time_clip
(
make_date
(
make_day
(
y
,
num_val
(
&
month
),
num_val
(
&
vdate
)),
make_time
(
num_val
(
&
hours
),
num_val
(
&
minutes
),
num_val
(
&
seconds
),
num_val
(
&
ms
)))),
&
date
);
hres
=
create_date
(
dispex
->
ctx
,
TRUE
,
num_val
(
&
ret_date
),
&
date
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
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