From e007912d9d94cd5957c8b869e93a86ccd555eb23 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 21 Nov 2023 19:25:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20UTSJSONObject=20=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E5=87=BD=E6=95=B0=E7=9A=84=E6=B5=8B=E8=AF=95=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/JSON.uts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/uni_modules/uts-tests/utssdk/JSON.uts b/uni_modules/uts-tests/utssdk/JSON.uts index 0bb9c93..63a1eb0 100644 --- a/uni_modules/uts-tests/utssdk/JSON.uts +++ b/uni_modules/uts-tests/utssdk/JSON.uts @@ -280,17 +280,19 @@ export function testJSON() : Result { }) test('UTSJSONOject', () => { - //var t1 = "1" - //const a = { - // test(){ - // t1 = "2" - // console.log("test") - // } - //} - //(a['test'] as ()=>void)() - //console.log(a['test']) - //expect(t1).toEqual("2") - }) + let t1 = "1" + const a = { + test(){ + t1 = "2" + console.log("test") + } + }; + //console.log(a['test']); + (a['test'] as ()=>void)() + //console.log(t1); + expect(t1).toEqual("2") + //console.log(JSON.stringify(a)); + }) }) -- GitLab