diff --git a/BUILD.gn b/BUILD.gn index c798dd5f71fef99fad0bfde3e143a1e0ccbbf7fd..489904622a34916647adddfd36b4e8537a48a151 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 0000000000000000000000000000000000000000..86c10adf02807b87ee44ec1625f2cb75fe22985b --- /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 4dd11f83beca07ff87dadd554d111dd089e5b18b..2cf2a2ce936dd514b9dc29df81512dccde7f8768 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 b9f0db3455287b5231bbb045503e016ff8b0e33f..40024dca9d568769563ebb0d587bb2b1c2b2bf8d 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 540aa43f9e677755d9d2eb1c0eccc3cf49855aea..4400416e13adcccf9b6b97105b5af7bb926fec85 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