Commit 809a91b8 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

jscript: Implement CollectGarbage().

parent e8ee6dda
......@@ -549,10 +549,7 @@ static HRESULT JSGlobal_ScriptEngineBuildVersion(script_ctx_t *ctx, jsval_t vthi
static HRESULT JSGlobal_CollectGarbage(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
static int once = 0;
if (!once++)
FIXME(": stub\n");
return S_OK;
return gc_run(ctx);
}
static HRESULT JSGlobal_encodeURI(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv,
......
......@@ -3452,6 +3452,7 @@ static void test_destructors(void)
"a.ref = { 'ref': Math, 'a': a }; b.ref = Math.ref;\n"
"a.self = a; b.self = b; c.self = c;\n"
"})(), true";
IActiveScriptParse *parser;
IActiveScript *script;
VARIANT v;
HRESULT hres;
......@@ -3479,6 +3480,25 @@ static void test_destructors(void)
CHECK_CALLED(testdestrobj);
IActiveScript_Release(script);
V_VT(&v) = VT_EMPTY;
hres = parse_script_expr(cyclic_refs, &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
SET_EXPECT(testdestrobj);
V_VT(&v) = VT_EMPTY;
hres = IActiveScriptParse_ParseScriptText(parser, L"Math.ref = undefined, CollectGarbage(), true",
NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &v, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
IActiveScriptParse_Release(parser);
CHECK_CALLED(testdestrobj);
IActiveScript_Release(script);
}
static void test_eval(void)
......
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