From a04e571d6a34cc8aa238435c98b36dd285ae913a Mon Sep 17 00:00:00 2001 From: daiwei Date: Mon, 26 Feb 2024 18:07:08 +0800 Subject: [PATCH 1/2] fix(warning): stringify args in warn handler --- packages/runtime-core/src/warning.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/warning.ts b/packages/runtime-core/src/warning.ts index 16928387dfb..9f67f13d916 100644 --- a/packages/runtime-core/src/warning.ts +++ b/packages/runtime-core/src/warning.ts @@ -45,7 +45,7 @@ export function warn(msg: string, ...args: any[]) { instance, ErrorCodes.APP_WARN_HANDLER, [ - msg + args.join(''), + msg + args.map(a => JSON.stringify(a)).join(''), instance && instance.proxy, trace .map( From 9ce8cad1cd4a1a18639044a92dcbe18a4836cd28 Mon Sep 17 00:00:00 2001 From: daiwei Date: Wed, 28 Feb 2024 14:10:04 +0800 Subject: [PATCH 2/2] chore: improve code --- packages/runtime-core/src/warning.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/warning.ts b/packages/runtime-core/src/warning.ts index 9f67f13d916..c3b2ebbd02d 100644 --- a/packages/runtime-core/src/warning.ts +++ b/packages/runtime-core/src/warning.ts @@ -45,7 +45,7 @@ export function warn(msg: string, ...args: any[]) { instance, ErrorCodes.APP_WARN_HANDLER, [ - msg + args.map(a => JSON.stringify(a)).join(''), + msg + args.map(a => a.toString?.() ?? JSON.stringify(a)).join(''), instance && instance.proxy, trace .map(