diff --git a/runtime/builtins/builtins_global.cpp b/runtime/builtins/builtins_global.cpp index 7275383cc6e7f4f196c2c96a14788aa62a60e29c..9506c33b9824f239004ff6375f2fa0a99f41a9fc 100644 --- a/runtime/builtins/builtins_global.cpp +++ b/runtime/builtins/builtins_global.cpp @@ -18,6 +18,8 @@ #include #include #include +#include "include/runtime.h" +#include "include/runtime_notification.h" #include "plugins/ecmascript/runtime/base/number_helper.h" #include "plugins/ecmascript/runtime/base/string_helper.h" #include "plugins/ecmascript/runtime/ecma_macros.h" @@ -468,16 +470,6 @@ JSTaggedValue BuiltinsGlobal::Decode(JSThread *thread, const JSHandleGetArgsNumber(); for (uint32_t i = 0; i < numArgs; i++) { JSHandle stringContent = JSTaggedValue::ToString(thread, GetCallArg(msg, i)); RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); - PrintString(thread, *stringContent); + + if (*stringContent) { + buffer += ConvertToString(*stringContent); + } if (i != numArgs - 1) { - std::cout << " "; + buffer += " "; } } - std::cout << std::endl; + + Runtime::GetCurrent()->GetNotificationManager()->PrintEvent(thread, buffer, false); + std::cout << buffer << std::endl; return JSTaggedValue::Undefined(); } diff --git a/runtime/builtins/builtins_global.h b/runtime/builtins/builtins_global.h index 61d75fa9242f29c9bc7275f72788769855e3252b..15a30ef17ab5b1beda2b3515a2f596554833a621 100644 --- a/runtime/builtins/builtins_global.h +++ b/runtime/builtins/builtins_global.h @@ -51,7 +51,6 @@ public: #endif private: - static void PrintString(JSThread *thread, EcmaString *string); static void PrintValue(int64_t value, int64_t tag); static JSTaggedValue Encode(JSThread *thread, const JSHandle &str, judgURIFunc IsInURISet); static JSTaggedValue Decode(JSThread *thread, const JSHandle &str, judgURIFunc IsInURISet);