mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 05:27:23 +00:00
update quickjs
This commit is contained in:
12
cxx/ffi.cpp
12
cxx/ffi.cpp
@@ -160,9 +160,8 @@ extern "C"
|
|||||||
DLLEXPORT JSValue *jsEval(JSContext *ctx, const char *input, size_t input_len, const char *filename, int32_t eval_flags)
|
DLLEXPORT JSValue *jsEval(JSContext *ctx, const char *input, size_t input_len, const char *filename, int32_t eval_flags)
|
||||||
{
|
{
|
||||||
JSRuntime *rt = JS_GetRuntime(ctx);
|
JSRuntime *rt = JS_GetRuntime(ctx);
|
||||||
uint8_t *stack_top = JS_SetStackTop(rt, 0);
|
JS_UpdateStackTop(rt);
|
||||||
JSValue *ret = new JSValue(JS_Eval(ctx, input, input_len, filename, eval_flags));
|
JSValue *ret = new JSValue(JS_Eval(ctx, input, input_len, filename, eval_flags));
|
||||||
JS_SetStackTop(rt, stack_top);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,9 +261,8 @@ extern "C"
|
|||||||
DLLEXPORT const char *jsToCString(JSContext *ctx, JSValueConst *val)
|
DLLEXPORT const char *jsToCString(JSContext *ctx, JSValueConst *val)
|
||||||
{
|
{
|
||||||
JSRuntime *rt = JS_GetRuntime(ctx);
|
JSRuntime *rt = JS_GetRuntime(ctx);
|
||||||
uint8_t *stack_top = JS_SetStackTop(rt, 0);
|
JS_UpdateStackTop(rt);
|
||||||
const char *ret = JS_ToCString(ctx, *val);
|
const char *ret = JS_ToCString(ctx, *val);
|
||||||
JS_SetStackTop(rt, stack_top);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,9 +353,8 @@ extern "C"
|
|||||||
int32_t argc, JSValueConst *argv)
|
int32_t argc, JSValueConst *argv)
|
||||||
{
|
{
|
||||||
JSRuntime *rt = JS_GetRuntime(ctx);
|
JSRuntime *rt = JS_GetRuntime(ctx);
|
||||||
uint8_t *stack_top = JS_SetStackTop(rt, 0);
|
JS_UpdateStackTop(rt);
|
||||||
JSValue *ret = new JSValue(JS_Call(ctx, *func_obj, *this_obj, argc, argv));
|
JSValue *ret = new JSValue(JS_Call(ctx, *func_obj, *this_obj, argc, argv));
|
||||||
JS_SetStackTop(rt, stack_top);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -373,10 +370,9 @@ extern "C"
|
|||||||
|
|
||||||
DLLEXPORT int32_t jsExecutePendingJob(JSRuntime *rt)
|
DLLEXPORT int32_t jsExecutePendingJob(JSRuntime *rt)
|
||||||
{
|
{
|
||||||
uint8_t *stack_top = JS_SetStackTop(rt, 0);
|
JS_UpdateStackTop(rt);
|
||||||
JSContext *ctx;
|
JSContext *ctx;
|
||||||
int ret = JS_ExecutePendingJob(rt, &ctx);
|
int ret = JS_ExecutePendingJob(rt, &ctx);
|
||||||
JS_SetStackTop(rt, stack_top);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Submodule cxx/quickjs updated: 7daa190ca7...d5bd943ea9
Reference in New Issue
Block a user