Commit 84d8cddc authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added Date constructor object implementation.

parent a9c4d2b1
...@@ -10,6 +10,7 @@ RC_SRCS = rsrc.rc ...@@ -10,6 +10,7 @@ RC_SRCS = rsrc.rc
C_SRCS = \ C_SRCS = \
array.c \ array.c \
bool.c \ bool.c \
date.c \
dispex.c \ dispex.c \
engine.c \ engine.c \
function.c \ function.c \
......
...@@ -99,8 +99,9 @@ static HRESULT JSGlobal_Boolean(DispatchEx *dispex, LCID lcid, WORD flags, DISPP ...@@ -99,8 +99,9 @@ static HRESULT JSGlobal_Boolean(DispatchEx *dispex, LCID lcid, WORD flags, DISPP
static HRESULT JSGlobal_Date(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, static HRESULT JSGlobal_Date(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{ {
FIXME("\n"); TRACE("\n");
return E_NOTIMPL;
return constructor_call(dispex->ctx->date_constr, lcid, flags, dp, retv, ei, sp);
} }
static HRESULT JSGlobal_Function(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, static HRESULT JSGlobal_Function(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
...@@ -418,6 +419,10 @@ static HRESULT init_constructors(script_ctx_t *ctx) ...@@ -418,6 +419,10 @@ static HRESULT init_constructors(script_ctx_t *ctx)
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = create_date_constr(ctx, &ctx->date_constr);
if(FAILED(hres))
return hres;
hres = create_number_constr(ctx, &ctx->number_constr); hres = create_number_constr(ctx, &ctx->number_constr);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
......
...@@ -67,6 +67,7 @@ typedef enum { ...@@ -67,6 +67,7 @@ typedef enum {
JSCLASS_NONE, JSCLASS_NONE,
JSCLASS_ARRAY, JSCLASS_ARRAY,
JSCLASS_BOOLEAN, JSCLASS_BOOLEAN,
JSCLASS_DATE,
JSCLASS_FUNCTION, JSCLASS_FUNCTION,
JSCLASS_GLOBAL, JSCLASS_GLOBAL,
JSCLASS_MATH, JSCLASS_MATH,
...@@ -170,6 +171,7 @@ struct _script_ctx_t { ...@@ -170,6 +171,7 @@ struct _script_ctx_t {
DispatchEx *function_constr; DispatchEx *function_constr;
DispatchEx *array_constr; DispatchEx *array_constr;
DispatchEx *bool_constr; DispatchEx *bool_constr;
DispatchEx *date_constr;
DispatchEx *number_constr; DispatchEx *number_constr;
DispatchEx *object_constr; DispatchEx *object_constr;
DispatchEx *regexp_constr; DispatchEx *regexp_constr;
...@@ -188,6 +190,7 @@ HRESULT init_function_constr(script_ctx_t*); ...@@ -188,6 +190,7 @@ HRESULT init_function_constr(script_ctx_t*);
HRESULT create_array_constr(script_ctx_t*,DispatchEx**); HRESULT create_array_constr(script_ctx_t*,DispatchEx**);
HRESULT create_bool_constr(script_ctx_t*,DispatchEx**); HRESULT create_bool_constr(script_ctx_t*,DispatchEx**);
HRESULT create_date_constr(script_ctx_t*,DispatchEx**);
HRESULT create_number_constr(script_ctx_t*,DispatchEx**); HRESULT create_number_constr(script_ctx_t*,DispatchEx**);
HRESULT create_object_constr(script_ctx_t*,DispatchEx**); HRESULT create_object_constr(script_ctx_t*,DispatchEx**);
HRESULT create_regexp_constr(script_ctx_t*,DispatchEx**); HRESULT create_regexp_constr(script_ctx_t*,DispatchEx**);
......
...@@ -81,6 +81,8 @@ ok(Math !== undefined, "Math is undefined"); ...@@ -81,6 +81,8 @@ ok(Math !== undefined, "Math is undefined");
ok(Math.prototype === undefined, "Math.prototype is not undefined"); ok(Math.prototype === undefined, "Math.prototype is not undefined");
ok(Function.prototype !== undefined, "Function.prototype is undefined"); ok(Function.prototype !== undefined, "Function.prototype is undefined");
ok(Function.prototype.prototype === undefined, "Function.prototype is not undefined"); ok(Function.prototype.prototype === undefined, "Function.prototype is not undefined");
ok(Date.prototype !== undefined, "Date.prototype is undefined");
ok(Date.prototype.prototype === undefined, "Date.prototype is not undefined");
Function.prototype.test = true; Function.prototype.test = true;
ok(testFunc1.test === true, "testFunc1.test !== true"); ok(testFunc1.test === true, "testFunc1.test !== true");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment