From 6a3e9b581eab82b05c4f70adf7d0be211cc6a9f9 Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Sat, 30 Oct 2021 22:05:10 +0800 Subject: [PATCH] zhongjianfei@huawei.com Signed-off-by: zhongjianfei Change-Id: Ie9cd0e7b152e78bda0e69c4a6197d2b9c038aac3 --- BUILD.gn | 2 ++ config.h | 30 ++++++++++++++++++++++++++++++ qjs.c | 1 + quickjs.c | 6 ++++++ quickjs.h | 2 ++ 5 files changed, 41 insertions(+) create mode 100644 config.h diff --git a/BUILD.gn b/BUILD.gn index c798dd5..4899046 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -43,6 +43,7 @@ config("qjs_debug_config") { qjs_sources = [ "cutils.c", + "libbf.c", "libregexp.c", "libunicode.c", "quickjs-libc.c", @@ -76,6 +77,7 @@ ohos_static_library("qjs") { ohos_executable("qjsc") { sources = [ "cutils.c", + "libbf.c", "libregexp.c", "libunicode.c", "qjsc.c", diff --git a/config.h b/config.h new file mode 100644 index 0000000..86c10ad --- /dev/null +++ b/config.h @@ -0,0 +1,30 @@ +/* + * QuickJS Javascript Engine + * + * Copyright (c) 2017-2020 Fabrice Bellard + * Copyright (c) 2017-2020 Charlie Gordon + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef CONFIG_H +#define CONFIG_H + +#define CONFIG_BIGNUM 1 + +#endif /* CONFIG_H */ diff --git a/qjs.c b/qjs.c index 4dd11f8..2cf2a2c 100644 --- a/qjs.c +++ b/qjs.c @@ -38,6 +38,7 @@ #include #endif +#include "config.h" #include "cutils.h" #include "quickjs-libc.h" diff --git a/quickjs.c b/quickjs.c index b9f0db3..40024dc 100644 --- a/quickjs.c +++ b/quickjs.c @@ -38,6 +38,7 @@ #include #endif +#include "config.h" #include "cutils.h" #include "list.h" #include "quickjs.h" @@ -54541,3 +54542,8 @@ JSValue JS_AceNewInstance(JSContext *ctx, int classId, int argc, JSValueConst *a JS_FreeValue(ctx, obj); return newInst; } + +JSValue JS_NewString16(JSContext *ctx, const uint16_t *buf, int len) +{ + return js_new_string16(ctx, buf, len); +} diff --git a/quickjs.h b/quickjs.h index 540aa43..4400416 100644 --- a/quickjs.h +++ b/quickjs.h @@ -1072,6 +1072,8 @@ JSValue JS_AceNewInstance(JSContext *ctx, int classId, int argc, JSValueConst *a #undef js_unlikely #undef js_force_inline +JSValue JS_NewString16(JSContext *ctx, const uint16_t *buf, int len); + #ifdef __cplusplus } /* extern "C" { */ #endif -- Gitee