jscript: Added Date.toGMTString implementation.

This commit is contained in:
Piotr Caban 2009-10-07 22:11:38 +02:00 committed by Alexandre Julliard
parent 8a68f418db
commit adc2a5697b
2 changed files with 13 additions and 7 deletions

View File

@ -675,9 +675,8 @@ static HRESULT Date_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
return S_OK;
}
/* ECMA-262 3rd Edition 15.9.5.42 */
static HRESULT Date_toUTCString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller)
static inline HRESULT create_utc_string(script_ctx_t *ctx, vdisp_t *jsthis,
VARIANT *retv, jsexcept_t *ei)
{
static const WCHAR NaNW[] = { 'N','a','N',0 };
static const WCHAR formatADW[] = { '%','s',',',' ','%','d',' ','%','s',' ','%','d',' ',
@ -702,8 +701,6 @@ static HRESULT Date_toUTCString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
int len, size, year, day;
DWORD lcid_en, week_id, month_id;
TRACE("\n");
if(!(date = date_this(jsthis)))
return throw_type_error(ctx, ei, IDS_NOT_DATE, NULL);
@ -781,11 +778,19 @@ static HRESULT Date_toUTCString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
return S_OK;
}
/* ECMA-262 3rd Edition 15.9.5.42 */
static HRESULT Date_toUTCString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller)
{
TRACE("\n");
return create_utc_string(ctx, jsthis, retv, ei);
}
static HRESULT Date_toGMTString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller)
{
FIXME("\n");
return E_NOTIMPL;
TRACE("\n");
return create_utc_string(ctx, jsthis, retv, ei);
}
/* ECMA-262 3rd Edition 15.9.5.3 */

View File

@ -1874,6 +1874,7 @@ testFunctions(Date.prototype, [
["toString", 0],
["toTimeString", 0],
["toUTCString", 0],
["toGMTString", 0],
["valueOf", 0]
]);