From f8afae75b5727462081e15b662f9bdf809229f8d Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 27 Dec 2010 13:38:08 +0100 Subject: [PATCH] jscript: Added ScriptEngine*Version functions implementation. --- dlls/jscript/global.c | 27 +++++++++++++++++++++------ dlls/jscript/resource.h | 4 ++++ dlls/jscript/tests/api.js | 3 +++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 0d922c8f009..f9595774020 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -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, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + 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, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + 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, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + 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, diff --git a/dlls/jscript/resource.h b/dlls/jscript/resource.h index be569e0a641..c4153a4a1f4 100644 --- a/dlls/jscript/resource.h +++ b/dlls/jscript/resource.h @@ -18,6 +18,10 @@ #include +#define JSCRIPT_MAJOR_VERSION 5 +#define JSCRIPT_MINOR_VERSION 8 +#define JSCRIPT_BUILD_VERSION 16475 + #define IDS_TO_PRIMITIVE 0x0001 #define IDS_INVALID_CALL_ARG 0x0005 #define IDS_SUBSCRIPT_OUT_OF_RANGE 0x0009 diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index aed6c846e70..e4dc7c40e96 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -20,6 +20,9 @@ var tmp, i; ok(ScriptEngine() === "JScript", "ScriptEngine() = " + ScriptEngine()); 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"); ok(i === 0, "parseInt('0') = " + i);