-- v3: WScript: Implement Sleep
From: Anders Kjersem andersdev@proton.me
--- programs/wscript/host.c | 7 +++++-- programs/wscript/tests/run.js | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/programs/wscript/host.c b/programs/wscript/host.c index 44336deac13..2e6ed964f63 100644 --- a/programs/wscript/host.c +++ b/programs/wscript/host.c @@ -395,8 +395,11 @@ static HRESULT WINAPI Host_DisconnectObject(IHost *iface, IDispatch *Object)
static HRESULT WINAPI Host_Sleep(IHost *iface, LONG Time) { - WINE_FIXME("(%ld)\n", Time); - return E_NOTIMPL; + TRACE("(%ld)\n", Time); + if (Time < 0) + return E_INVALIDARG; + Sleep(Time); + return S_OK; }
static HRESULT WINAPI Host_ConnectObject(IHost *iface, IDispatch *Object, BSTR Prefix) diff --git a/programs/wscript/tests/run.js b/programs/wscript/tests/run.js index a812a85c9e0..7433f642f14 100644 --- a/programs/wscript/tests/run.js +++ b/programs/wscript/tests/run.js @@ -48,6 +48,11 @@ ok(WScript.Interactive === false, "WScript.Interactive = " + WScript.Interactive WScript.Interactive = true; ok(WScript.Interactive === true, "WScript.Interactive = " + WScript.Interactive); ok(WScript.Application === WScript, "WScript.Application = " + WScript.Application); +WScript.Sleep(0); +try { + WScript.Sleep(-1); + ok(false, "expected exception"); +}catch(e) {}
var obj = WScript.CreateObject("Wine.Test"); obj.ok(true, "Broken WScript.CreateObject object?");