From 3aa8034a0b8308b719acbd264ff985dd10f6415a Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 24 Apr 2026 08:49:53 +0000 Subject: [PATCH] =?UTF-8?q?js-on-sx:=20runner=20harness=20=E2=80=94=20asse?= =?UTF-8?q?rt()=20callable,=20verify*=20tolerate=20more=20args?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many test262 tests write 'assert(condition, msg)' as a plain call, not 'assert.sameValue(...)'. The stub now sets assert.__callable__ to __assert_call__ so the dispatch in js-call-plain finds a callable. Also widens verifyNotEnumerable etc. to 5-arg signatures — some tests call them with (o, name, value, writable, configurable). Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/js/test262-runner.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/js/test262-runner.py b/lib/js/test262-runner.py index 580c4b11..0fa15c97 100644 --- a/lib/js/test262-runner.py +++ b/lib/js/test262-runner.py @@ -109,6 +109,8 @@ var __assert_call__ = function (b, m) { if (b) { return; } throw new Test262Error(m || "assertion failed"); }; +// Make `assert` itself callable — many tests write `assert(x, "msg")`. +assert.__callable__ = __assert_call__; // compareArray stub — minimal for cases that only compareArray arrays of primitives assert.compareArray = function (a, b, m) { var msg = m || ""; @@ -128,12 +130,12 @@ var verifyProperty = function (obj, name, desc, opts) { } }; var verifyPrimordialProperty = verifyProperty; -var verifyNotEnumerable = function (o, n) { }; -var verifyNotWritable = function (o, n) { }; -var verifyNotConfigurable = function (o, n) { }; -var verifyEnumerable = function (o, n) { }; -var verifyWritable = function (o, n) { }; -var verifyConfigurable = function (o, n) { }; +var verifyNotEnumerable = function (o, n, v, w, x) { }; +var verifyNotWritable = function (o, n, v, w, x) { }; +var verifyNotConfigurable = function (o, n, v, w, x) { }; +var verifyEnumerable = function (o, n, v, w, x) { }; +var verifyWritable = function (o, n, v, w, x) { }; +var verifyConfigurable = function (o, n, v, w, x) { }; // isConstructor stub — we can't actually probe; assume falsy constructor for arrows/functions var isConstructor = function (f) { if (typeof f !== "function") { return false; }