From d73b24746867bbc0dc6bfc48c3ef15cd7d87ee34 Mon Sep 17 00:00:00 2001 From: m0_75226990 Date: Thu, 31 Aug 2023 15:41:33 +0800 Subject: [PATCH] remove instanceof String, Number, Boolean --- uni_modules/uts-tests/utssdk/KeyWord.uts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uni_modules/uts-tests/utssdk/KeyWord.uts b/uni_modules/uts-tests/utssdk/KeyWord.uts index c4e9313..0059876 100644 --- a/uni_modules/uts-tests/utssdk/KeyWord.uts +++ b/uni_modules/uts-tests/utssdk/KeyWord.uts @@ -45,12 +45,12 @@ export function testKeyWord(): Result { let user1:any = new User() let instanceRet1 = user1 instanceof User expect(instanceRet1).toEqual(true) - let instanceRet2 = user1 instanceof String + let instanceRet2 = (typeof user1) == "string" expect(instanceRet2).toEqual(false) let num1:any = 3.1415926 - let instanceRet3 = num1 instanceof String + let instanceRet3 = (typeof num1) == "string" expect(instanceRet3).toEqual(false) - let instanceRet4 = num1 instanceof Number + let instanceRet4 = (typeof num1) == "number" expect(instanceRet4).toEqual(true) }) -- GitLab