jscript: Added ScriptEngine*Version functions implementation.

This commit is contained in:
Jacek Caban 2010-12-27 13:38:08 +01:00 committed by Alexandre Julliard
parent 36fe9472c2
commit f8afae75b5
3 changed files with 28 additions and 6 deletions

View File

@ -727,22 +727,37 @@ static HRESULT JSGlobal_ScriptEngine(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
static HRESULT JSGlobal_ScriptEngineMajorVersion(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, static HRESULT JSGlobal_ScriptEngineMajorVersion(script_ctx_t *ctx, vdisp_t *jsthis, 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;
if(retv) {
V_VT(retv) = VT_I4;
V_I4(retv) = JSCRIPT_MAJOR_VERSION;
}
return S_OK;
} }
static HRESULT JSGlobal_ScriptEngineMinorVersion(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, static HRESULT JSGlobal_ScriptEngineMinorVersion(script_ctx_t *ctx, vdisp_t *jsthis, 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;
if(retv) {
V_VT(retv) = VT_I4;
V_I4(retv) = JSCRIPT_MINOR_VERSION;
}
return S_OK;
} }
static HRESULT JSGlobal_ScriptEngineBuildVersion(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, static HRESULT JSGlobal_ScriptEngineBuildVersion(script_ctx_t *ctx, vdisp_t *jsthis, 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;
if(retv) {
V_VT(retv) = VT_I4;
V_I4(retv) = JSCRIPT_BUILD_VERSION;
}
return S_OK;
} }
static HRESULT JSGlobal_CollectGarbage(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, static HRESULT JSGlobal_CollectGarbage(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,

View File

@ -18,6 +18,10 @@
#include <windef.h> #include <windef.h>
#define JSCRIPT_MAJOR_VERSION 5
#define JSCRIPT_MINOR_VERSION 8
#define JSCRIPT_BUILD_VERSION 16475
#define IDS_TO_PRIMITIVE 0x0001 #define IDS_TO_PRIMITIVE 0x0001
#define IDS_INVALID_CALL_ARG 0x0005 #define IDS_INVALID_CALL_ARG 0x0005
#define IDS_SUBSCRIPT_OUT_OF_RANGE 0x0009 #define IDS_SUBSCRIPT_OUT_OF_RANGE 0x0009

View File

@ -20,6 +20,9 @@ var tmp, i;
ok(ScriptEngine() === "JScript", "ScriptEngine() = " + ScriptEngine()); ok(ScriptEngine() === "JScript", "ScriptEngine() = " + ScriptEngine());
ok(ScriptEngine(3) === "JScript", "ScriptEngine(3) = " + ScriptEngine(3)); ok(ScriptEngine(3) === "JScript", "ScriptEngine(3) = " + ScriptEngine(3));
ok(ScriptEngineMajorVersion() === ScriptEngineMajorVersion(2), "ScriptEngineMajorVersion() !== ScriptEngineMajorVersion(2)");
ok(ScriptEngineMinorVersion() === ScriptEngineMinorVersion(2), "ScriptEngineMinorVersion() !== ScriptEngineMinorVersion(2)");
ok(ScriptEngineBuildVersion() === ScriptEngineBuildVersion(2), "ScriptEngineBuildVersion() !== ScriptEngineBuildVersion(2)");
i = parseInt("0"); i = parseInt("0");
ok(i === 0, "parseInt('0') = " + i); ok(i === 0, "parseInt('0') = " + i);