fix fd.c bugs
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user