mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 05:27:23 +00:00
v0.3.2
This commit is contained in:
14
cxx/ffi.cpp
14
cxx/ffi.cpp
@@ -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)
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@ extern "C"
|
||||
|
||||
typedef void *JSChannel(JSContext *ctx, size_t type, void *argv);
|
||||
|
||||
DLLEXPORT JSValue *jsThrowInternalError(JSContext *ctx, char *message);
|
||||
DLLEXPORT JSValue *jsThrow(JSContext *ctx, JSValue *obj);
|
||||
|
||||
DLLEXPORT JSValue *jsEXCEPTION();
|
||||
|
||||
@@ -95,6 +95,10 @@ extern "C"
|
||||
|
||||
DLLEXPORT int32_t jsIsArray(JSContext *ctx, JSValueConst *val);
|
||||
|
||||
DLLEXPORT int32_t jsIsError(JSContext *ctx, JSValueConst *val);
|
||||
|
||||
DLLEXPORT JSValue *jsNewError(JSContext *ctx);
|
||||
|
||||
DLLEXPORT JSValue *jsGetProperty(JSContext *ctx, JSValueConst *this_obj,
|
||||
JSAtom prop);
|
||||
|
||||
|
Reference in New Issue
Block a user