From 062241dba95e5060aeb559d00aacb56596c88a26 Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Thu, 7 Jul 2022 20:53:31 +0800 Subject: [PATCH 1/3] Switch component ark_ts2abc to arkcompiler_ets_frontend Signed-off-by: chenqy930 Change-Id: I6e8c689d51a8a67edddea3be3c83a46bf7be5b57 --- build_ts_js.py | 2 +- container/BUILD.gn | 7 ++++--- container/build_ts_js.py | 2 +- util/BUILD.gn | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build_ts_js.py b/build_ts_js.py index 20ec59e..cc7e81a 100755 --- a/build_ts_js.py +++ b/build_ts_js.py @@ -47,7 +47,7 @@ if __name__ == '__main__': node-v12.18.4-linux-x64/bin/node' if not os.path.exists(NODE_PATH): raise Exception('NO souch file or directory') - TSC_PATH = '../../../../ark/ts2abc/ts2panda/node_modules/\ + TSC_PATH = '../../../../arkcompiler/ets_frontend/ts2panda/node_modules/\ typescript/bin/tsc' CMD_INST = [NODE_PATH, TSC_PATH] run_command(CMD_INST) diff --git a/container/BUILD.gn b/container/BUILD.gn index 5c65243..1807d3d 100644 --- a/container/BUILD.gn +++ b/container/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/ts2abc/ts2panda/ts2abc_config.gni") +import("//arkcompiler/ets_frontend/ts2panda/ts2abc_config.gni") import("//build/ohos.gni") import("//build/ohos/ace/ace.gni") import("//foundation/arkui/ace_engine/ace_config.gni") @@ -67,7 +67,8 @@ template("container_lib") { # compile .js to .abc. action("gen_" + name + "_abc") { visibility = [ ":*" ] - script = "//ark/ts2abc/ts2panda/scripts/generate_js_bytecode.py" + script = + "//arkcompiler/ets_frontend/ts2panda/scripts/generate_js_bytecode.py" args = [ "--src-js", @@ -84,7 +85,7 @@ template("container_lib") { ] deps = [ ":build_js_ts", - "//ark/ts2abc/ts2panda:ark_ts2abc_build", + "//arkcompiler/ets_frontend/ts2panda:ark_ts2abc_build", ] inputs = [ target_out_dir + "/js_" + name + ".js" ] diff --git a/container/build_ts_js.py b/container/build_ts_js.py index 20abe9e..8200dc5 100755 --- a/container/build_ts_js.py +++ b/container/build_ts_js.py @@ -40,7 +40,7 @@ if __name__ == '__main__': NODE_PATH = '../../../../prebuilts/build-tools/common/nodejs/\ node-v12.18.4-linux-x64/bin/node' - TSC_PATH = '../../../../ark/ts2abc/ts2panda/node_modules/typescript/bin/tsc' + TSC_PATH = '../../../../arkcompiler/ets_frontend/ts2panda/node_modules/typescript/bin/tsc' cmd = [NODE_PATH, TSC_PATH] run_command(cmd) diff --git a/util/BUILD.gn b/util/BUILD.gn index db50055..dffba0e 100755 --- a/util/BUILD.gn +++ b/util/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/ts2abc/ts2panda/ts2abc_config.gni") +import("//arkcompiler/ets_frontend/ts2panda/ts2abc_config.gni") import("//build/ohos.gni") import("//build/ohos/ace/ace.gni") import("//foundation/arkui/ace_engine/ace_config.gni") @@ -43,7 +43,7 @@ gen_js_obj("util_js") { # compile .js to .abc. action("gen_util_abc") { visibility = [ ":*" ] - script = "//ark/ts2abc/ts2panda/scripts/generate_js_bytecode.py" + script = "//arkcompiler/ets_frontend/ts2panda/scripts/generate_js_bytecode.py" args = [ "--src-js", @@ -60,7 +60,7 @@ action("gen_util_abc") { ] deps = [ ":build_ts_js", - "//ark/ts2abc/ts2panda:ark_ts2abc_build", + "//arkcompiler/ets_frontend/ts2panda:ark_ts2abc_build", ] inputs = [ target_out_dir + "/util_js.js" ] -- Gitee From ea009a1bc015b330bcc1c89a65dd5363a66fd5ac Mon Sep 17 00:00:00 2001 From: wangben Date: Mon, 18 Jul 2022 14:03:44 +0800 Subject: [PATCH 2/3] Fix codex issues:https://gitee.com/openharmony/js_util_module/issues/I5HJRN Signed-off-by: wangben --- util/native_module_util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/native_module_util.cpp b/util/native_module_util.cpp index b866bf7..16a9f6c 100755 --- a/util/native_module_util.cpp +++ b/util/native_module_util.cpp @@ -392,7 +392,7 @@ namespace OHOS::Util { return retVal; } - static bool CheckEncodingFormat(std::string &encoding) + static bool CheckEncodingFormat(const std::string &encoding) { const std::string conventFormat("utf8-t,UTF-8,gbk,GBK,GB2312,gb2312,GB18030,gb18030"); if (conventFormat.find(encoding.c_str()) != conventFormat.npos) { -- Gitee From c037c4acc66fe7944c6027fb528c15965a9cfa58 Mon Sep 17 00:00:00 2001 From: lukai Date: Thu, 21 Jul 2022 20:24:17 +0800 Subject: [PATCH 3/3] utilxts bugfix 1. u_setDataDirectory() is not thread-safe 2. fix double free issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5I1FL?from=project-issue Signed-off-by: lukai Change-Id: Ie8752bb2ce514afd7b1c8895141d319e58208d89 --- util/js_base64.cpp | 2 -- util/js_textdecoder.cpp | 1 - 2 files changed, 3 deletions(-) diff --git a/util/js_base64.cpp b/util/js_base64.cpp index 5443144..70ef655 100755 --- a/util/js_base64.cpp +++ b/util/js_base64.cpp @@ -456,8 +456,6 @@ namespace OHOS::Util { inputDecode = static_cast(resultData) + byteOffset; CreateDecodePromise(env, inputDecode, length); } - delete[] inputString; - inputString = nullptr; return stdDecodeInfo_->promise; } void Base64::CreateDecodePromise(napi_env env, char *inputDecode, size_t length) diff --git a/util/js_textdecoder.cpp b/util/js_textdecoder.cpp index 6bb026d..2ef93df 100755 --- a/util/js_textdecoder.cpp +++ b/util/js_textdecoder.cpp @@ -42,7 +42,6 @@ namespace OHOS::Util { } } label_ = i32Flag; - SetHwIcuDirectory(); bool fatal = (i32Flag & static_cast(ConverterFlags::FATAL_FLG)) == static_cast(ConverterFlags::FATAL_FLG); -- Gitee