js-on-sx: runner harness — assert() callable, verify* tolerate more args
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) <noreply@anthropic.com>
This commit is contained in:
@@ -109,6 +109,8 @@ var __assert_call__ = function (b, m) {
|
|||||||
if (b) { return; }
|
if (b) { return; }
|
||||||
throw new Test262Error(m || "assertion failed");
|
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
|
// compareArray stub — minimal for cases that only compareArray arrays of primitives
|
||||||
assert.compareArray = function (a, b, m) {
|
assert.compareArray = function (a, b, m) {
|
||||||
var msg = m || "";
|
var msg = m || "";
|
||||||
@@ -128,12 +130,12 @@ var verifyProperty = function (obj, name, desc, opts) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var verifyPrimordialProperty = verifyProperty;
|
var verifyPrimordialProperty = verifyProperty;
|
||||||
var verifyNotEnumerable = function (o, n) { };
|
var verifyNotEnumerable = function (o, n, v, w, x) { };
|
||||||
var verifyNotWritable = function (o, n) { };
|
var verifyNotWritable = function (o, n, v, w, x) { };
|
||||||
var verifyNotConfigurable = function (o, n) { };
|
var verifyNotConfigurable = function (o, n, v, w, x) { };
|
||||||
var verifyEnumerable = function (o, n) { };
|
var verifyEnumerable = function (o, n, v, w, x) { };
|
||||||
var verifyWritable = function (o, n) { };
|
var verifyWritable = function (o, n, v, w, x) { };
|
||||||
var verifyConfigurable = function (o, n) { };
|
var verifyConfigurable = function (o, n, v, w, x) { };
|
||||||
// isConstructor stub — we can't actually probe; assume falsy constructor for arrows/functions
|
// isConstructor stub — we can't actually probe; assume falsy constructor for arrows/functions
|
||||||
var isConstructor = function (f) {
|
var isConstructor = function (f) {
|
||||||
if (typeof f !== "function") { return false; }
|
if (typeof f !== "function") { return false; }
|
||||||
|
|||||||
Reference in New Issue
Block a user