From 65e21963173b1741badc0a626b2603225e385550 Mon Sep 17 00:00:00 2001 From: lijincheng Date: Mon, 30 Jun 2025 16:35:10 +0800 Subject: [PATCH] Json enum bugfix 1.do not check reference cycle for primitive type Issue:https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICIV5N Signed-off-by: lijincheng --- static_core/plugins/ets/stdlib/escompat/json.ets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static_core/plugins/ets/stdlib/escompat/json.ets b/static_core/plugins/ets/stdlib/escompat/json.ets index 56b397048c..3cc96f4fe5 100644 --- a/static_core/plugins/ets/stdlib/escompat/json.ets +++ b/static_core/plugins/ets/stdlib/escompat/json.ets @@ -1181,6 +1181,10 @@ class JSONWriter { return } + if (Type.of(obj).isPrimitive()) { + return + } + const cycleDetected = this.path.has(obj) if (cycleDetected) { throw new TypeError("cyclic object value") -- Gitee