From a0b268eed80fbe442af636d6ac30bbeb1acb2a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Mon, 20 Jan 2025 20:43:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BE=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uts-test-syntax-union/utssdk/equalityNarrowing.uts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/uni_modules/uts-test-syntax-union/utssdk/equalityNarrowing.uts b/uni_modules/uts-test-syntax-union/utssdk/equalityNarrowing.uts index e5555eb..fe29f25 100644 --- a/uni_modules/uts-test-syntax-union/utssdk/equalityNarrowing.uts +++ b/uni_modules/uts-test-syntax-union/utssdk/equalityNarrowing.uts @@ -1,8 +1,17 @@ function test(x: string | number, y: string | boolean) { + // #ifdef APP-ANDROID || APP-IOS if (x == y) { // We can now call any 'string' method on 'x' or 'y'. return x.toUpperCase() + y.toLowerCase(); } + // #endif + + // #ifndef APP-ANDROID || APP-IOS + if (x === y) { + // We can now call any 'string' method on 'x' or 'y'. + return x.toUpperCase() + y.toLowerCase(); + } + // #endif return JSON.stringify([x, y]); } -- GitLab