jscript: Added Function.length implementation.

This commit is contained in:
Jacek Caban 2008-09-09 01:27:38 +02:00 committed by Alexandre Julliard
parent 99b4bc2347
commit a0170ad7f9
3 changed files with 18 additions and 3 deletions

View File

@ -42,8 +42,21 @@ static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','
static HRESULT Function_length(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
return E_NOTIMPL;
FunctionInstance *This = (FunctionInstance*)dispex;
TRACE("%p %d\n", This, This->length);
switch(flags) {
case DISPATCH_PROPERTYGET:
V_VT(retv) = VT_I4;
V_I4(retv) = This->length;
break;
default:
FIXME("unimplemented flags %x\n", flags);
return E_NOTIMPL;
}
return S_OK;
}
static HRESULT Function_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,

View File

@ -256,10 +256,10 @@ static const builtin_prop_t JSGlobal_props[] = {
{NumberW, JSGlobal_Number, PROPF_CONSTR},
{ObjectW, JSGlobal_Object, PROPF_CONSTR},
{RegExpW, JSGlobal_RegExp, PROPF_CONSTR},
{ScriptEngineW, JSGlobal_ScriptEngine, PROPF_METHOD},
{ScriptEngineBuildVersionW, JSGlobal_ScriptEngineBuildVersion, PROPF_METHOD},
{ScriptEngineMajorVersionW, JSGlobal_ScriptEngineMajorVersion, PROPF_METHOD},
{ScriptEngineMinorVersionW, JSGlobal_ScriptEngineMinorVersion, PROPF_METHOD},
{ScriptEngineW, JSGlobal_ScriptEngine, PROPF_METHOD},
{StringW, JSGlobal_String, PROPF_CONSTR},
{VBArrayW, JSGlobal_VBArray, PROPF_METHOD},
{escapeW, JSGlobal_escape, PROPF_METHOD},

View File

@ -38,4 +38,6 @@ ok(null !== undefined, "null !== undefined is false");
var trueVar = true;
ok(trueVar, "trueVar is not true");
ok(ScriptEngine.length === 0, "ScriptEngine.length is not 0");
reportSuccess();