summaryrefslogtreecommitdiff
path: root/run-test262.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2025-04-22 19:09:26 +0200
committerFabrice Bellard <fabrice@bellard.org>2025-04-22 19:10:47 +0200
commit87cf1b0567b9d581e8a5247ea83c66bfdcb2eca8 (patch)
tree8e721d0efb450d8a51d3c3965200430a5eb8ce46 /run-test262.c
parent3bffe67e6b0994553fce3f639b42de818f5967d5 (diff)
downloadquickjs-87cf1b0567b9d581e8a5247ea83c66bfdcb2eca8.tar.gz
quickjs-87cf1b0567b9d581e8a5247ea83c66bfdcb2eca8.zip
run-test262: added $262.gc()
Diffstat (limited to 'run-test262.c')
-rw-r--r--run-test262.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/run-test262.c b/run-test262.c
index a42b9b5..4397a1d 100644
--- a/run-test262.c
+++ b/run-test262.c
@@ -757,6 +757,13 @@ static JSValue js_IsHTMLDDA(JSContext *ctx, JSValue this_val,
return JS_NULL;
}
+static JSValue js_gc(JSContext *ctx, JSValueConst this_val,
+ int argc, JSValueConst *argv)
+{
+ JS_RunGC(JS_GetRuntime(ctx));
+ return JS_UNDEFINED;
+}
+
static JSValue add_helpers1(JSContext *ctx)
{
JSValue global_obj;
@@ -790,6 +797,8 @@ static JSValue add_helpers1(JSContext *ctx)
obj = JS_NewCFunction(ctx, js_IsHTMLDDA, "IsHTMLDDA", 0);
JS_SetIsHTMLDDA(ctx, obj);
JS_SetPropertyStr(ctx, obj262, "IsHTMLDDA", obj);
+ JS_SetPropertyStr(ctx, obj262, "gc",
+ JS_NewCFunction(ctx, js_gc, "gc", 0));
JS_SetPropertyStr(ctx, global_obj, "$262", JS_DupValue(ctx, obj262));