This commit is contained in:
ekibun
2021-01-26 01:20:25 +08:00
parent b790073045
commit 896d563ba8
9 changed files with 166 additions and 89 deletions

View File

@@ -13,9 +13,9 @@
extern "C"
{
DLLEXPORT JSValue *jsThrowInternalError(JSContext *ctx, char *message)
DLLEXPORT JSValue *jsThrow(JSContext *ctx, JSValue *obj)
{
return new JSValue(JS_ThrowInternalError(ctx, "%s", message));
return new JSValue(JS_Throw(ctx, *obj));
}
DLLEXPORT JSValue *jsEXCEPTION()
@@ -293,6 +293,16 @@ extern "C"
return JS_IsArray(ctx, *val);
}
DLLEXPORT int32_t jsIsError(JSContext *ctx, JSValueConst *val)
{
return JS_IsError(ctx, *val);
}
DLLEXPORT JSValue *jsNewError(JSContext *ctx)
{
return new JSValue(JS_NewError(ctx));
}
DLLEXPORT JSValue *jsGetProperty(JSContext *ctx, JSValueConst *this_obj,
JSAtom prop)
{