From 41d827c3915d4cb39fb13632a3e6be10e155e8c0 Mon Sep 17 00:00:00 2001 From: zhujie81 Date: Fri, 17 Feb 2023 09:50:32 +0800 Subject: [PATCH] Internationalized module isolation scheme Isolation intl function code https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I6F2WR Signed-off-by: zhujie81 --- tooling/BUILD.gn | 7 +++++++ tooling/agent/runtime_impl.cpp | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tooling/BUILD.gn b/tooling/BUILD.gn index ed8b0d04..f7e44379 100644 --- a/tooling/BUILD.gn +++ b/tooling/BUILD.gn @@ -97,6 +97,13 @@ source_set("libark_ecma_debugger_set") { } } + if (enable_ark_intl) { + if (!defined(defines)) { + defines = [] + } + defines += [ "ARK_SUPPORT_INTL" ] + } + cflags_cc = [ "-fvisibility=hidden" ] } diff --git a/tooling/agent/runtime_impl.cpp b/tooling/agent/runtime_impl.cpp index 60d1a5ff..09bd468b 100644 --- a/tooling/agent/runtime_impl.cpp +++ b/tooling/agent/runtime_impl.cpp @@ -219,12 +219,14 @@ DispatchResponse RuntimeImpl::GetProperties(const GetPropertiesParams ¶ms, GetGeneratorFunctionValue(value, outPropertyDesc); } else if (value->IsGeneratorObject()) { GetGeneratorObjectValue(value, outPropertyDesc); +#ifdef ARK_SUPPORT_INTL } else if (value->IsJSNumberFormat()) { GetNumberFormatValue(value, outPropertyDesc); } else if (value->IsJSCollator()) { GetCollatorValue(value, outPropertyDesc); } else if (value->IsJSDateTimeFormat()) { GetDateTimeFormatValue(value, outPropertyDesc); +#endif } else if (value->IsMap()) { GetMapValue(value, outPropertyDesc); } else if (value->IsRegExp()) { @@ -519,7 +521,7 @@ void RuntimeImpl::GetGeneratorObjectValue(Local value, SetKeyValue(jsValueRef, outPropertyDesc, "[[GeneratorReceiver]]"); } } - +#ifdef ARK_SUPPORT_INTL void RuntimeImpl::GetNumberFormatValue(Local value, std::vector> *outPropertyDesc) { @@ -543,7 +545,7 @@ void RuntimeImpl::GetDateTimeFormatValue(Local value, Local jsValueRef = dtFormatRef->GetFormatFunction(vm_); SetKeyValue(jsValueRef, outPropertyDesc, "format"); } - +#endif void RuntimeImpl::AddInternalProperties(Local object, ArkInternalValueType type) { if (internalObjects_.IsEmpty()) { -- Gitee