From 3561ff13ce1fdae6009f98172ba6189d2d841ccf Mon Sep 17 00:00:00 2001 From: duqingquan Date: Mon, 7 Aug 2023 20:54:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97=20instanceOf=20?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/KeyWord.uts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/uni_modules/uts-tests/utssdk/KeyWord.uts b/uni_modules/uts-tests/utssdk/KeyWord.uts index bc48e2c..aa9aaba 100644 --- a/uni_modules/uts-tests/utssdk/KeyWord.uts +++ b/uni_modules/uts-tests/utssdk/KeyWord.uts @@ -24,12 +24,16 @@ export function testKeyWord(): Result { test('instanceof', () => { - let user1 = new User() + let user1:any = new User() let instanceRet1 = user1 instanceof User expect(instanceRet1).toEqual(true) let instanceRet2 = user1 instanceof String expect(instanceRet2).toEqual(false) - + let num1:any = 3.1415926 + let instanceRet3 = num1 instanceof String + expect(instanceRet3).toEqual(false) + let instanceRet4 = num1 instanceof Number + expect(instanceRet4).toEqual(true) }) -- GitLab