Commit 8482abe2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added String constructor object.

parent dd01f8b8
......@@ -16,7 +16,8 @@ C_SRCS = \
jscript_main.c \
jsutils.c \
lex.c \
object.c
object.c \
string.c
IDL_TLB_SRCS = jsglobal.idl
......
......@@ -125,8 +125,9 @@ static HRESULT JSGlobal_Object(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
static HRESULT JSGlobal_String(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
return E_NOTIMPL;
TRACE("\n");
return constructor_call(dispex->ctx->string_constr, lcid, flags, dp, retv, ei, sp);
}
static HRESULT JSGlobal_RegExp(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
......@@ -301,6 +302,10 @@ static HRESULT init_constructors(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
hres = create_string_constr(ctx, &ctx->string_constr);
if(FAILED(hres))
return hres;
return S_OK;
}
......
......@@ -51,7 +51,8 @@ typedef enum {
JSCLASS_NONE,
JSCLASS_FUNCTION,
JSCLASS_GLOBAL,
JSCLASS_OBJECT
JSCLASS_OBJECT,
JSCLASS_STRING
} jsclass_t;
typedef HRESULT (*builtin_invoke_t)(DispatchEx*,LCID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*);
......@@ -128,6 +129,7 @@ struct _script_ctx_t {
DispatchEx *script_disp;
DispatchEx *global;
DispatchEx *object_constr;
DispatchEx *string_constr;
};
void script_release(script_ctx_t*);
......@@ -140,6 +142,7 @@ static inline void script_addref(script_ctx_t *ctx)
HRESULT init_global(script_ctx_t*);
HRESULT create_object_constr(script_ctx_t*,DispatchEx**);
HRESULT create_string_constr(script_ctx_t*,DispatchEx**);
const char *debugstr_variant(const VARIANT*);
......
......@@ -48,5 +48,6 @@ ok(testFunc1.length === 2, "testFunc1.length is not 2");
ok(Object.prototype !== undefined, "Object.prototype is undefined");
ok(Object.prototype.prototype === undefined, "Object.prototype is not undefined");
ok(String.prototype !== undefined, "String.prototype is undefined");
reportSuccess();
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