Module: wine Branch: master Commit: adc2a5697b745c49ea33a14721f2c5dc1172c408 URL: http://source.winehq.org/git/wine.git/?a=commit;h=adc2a5697b745c49ea33a14721...
Author: Piotr Caban piotr.caban@gmail.com Date: Wed Oct 7 22:11:38 2009 +0200
jscript: Added Date.toGMTString implementation.
---
dlls/jscript/date.c | 19 ++++++++++++------- dlls/jscript/tests/api.js | 1 + 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index c753587..f8d3522 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -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 */ diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 268820c..ea1a5b2 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1874,6 +1874,7 @@ testFunctions(Date.prototype, [ ["toString", 0], ["toTimeString", 0], ["toUTCString", 0], + ["toGMTString", 0], ["valueOf", 0] ]);