fix fd.c bugs

This commit is contained in:
2026-02-10 14:21:49 -06:00
parent 54673e4a04
commit fe5dc6ecc9
10 changed files with 815 additions and 794 deletions

View File

@@ -3125,13 +3125,18 @@ JSValue JS_CallRegisterVM(JSContext *ctx, JSCodeRegister *code,
goto disrupt;
} else {
/* Record method call: get property, call with this=obj */
if (JS_IsNull(frame->slots[base])) {
JS_ThrowTypeError(ctx, "cannot read properties of null");
JS_PopGCRef(ctx, &key_ref);
goto disrupt;
}
JSValue method = JS_GetProperty(ctx, frame->slots[base], key_ref.val);
frame = (JSFrameRegister *)JS_VALUE_GET_PTR(frame_ref.val);
if (JS_IsException(method)) { JS_PopGCRef(ctx, &key_ref); goto disrupt; }
if (!JS_IsFunction(method)) {
frame->slots[base] = JS_NULL;
JS_ThrowTypeError(ctx, "not a function");
JS_PopGCRef(ctx, &key_ref);
break;
goto disrupt;
}
JSFunction *fn = JS_VALUE_GET_FUNCTION(method);
if (fn->kind == JS_FUNC_KIND_C) {