fix tests

This commit is contained in:
2026-02-24 16:55:07 -06:00
parent 7bd17c6476
commit c2f57d1dae
10 changed files with 1179 additions and 96 deletions

View File

@@ -246,7 +246,7 @@ typedef enum MachOpcode {
MACH_LENGTH, /* R(A) = length(R(B)) — array/text/blob length */
MACH_IS_PROXY, /* R(A) = is_function(R(B)) && R(B).length == 2 */
MACH_IS_BLOB, /* R(A) = is_blob(R(B)) */
MACH_IS_DATA, /* R(A) = is_data(R(B)) — plain record, not array/func/blob */
MACH_IS_DATA, /* R(A) = is_data(R(B)) — not function or null */
MACH_IS_TRUE, /* R(A) = (R(B) === true) */
MACH_IS_FALSE, /* R(A) = (R(B) === false) */
MACH_IS_FIT, /* R(A) = is_fit(R(B)) — safe integer */
@@ -2398,10 +2398,8 @@ vm_dispatch:
VM_BREAK();
VM_CASE(MACH_IS_DATA): {
JSValue v = frame->slots[b];
int result = 0;
if (mist_is_gc_object(v) && !mist_is_array(v)
&& !mist_is_function(v) && !mist_is_blob(v))
result = 1;
/* data is text, number, logical, array, blob, or record — not function, null */
int result = (v != JS_NULL && !mist_is_function(v));
frame->slots[a] = JS_NewBool(ctx, result);
VM_BREAK();
}