From 243561126475456c5d6616e42fb6828f50c2265a Mon Sep 17 00:00:00 2001 From: oh-rgx Date: Sun, 13 Apr 2025 16:11:36 +0800 Subject: [PATCH] Compilation error for keywords Issue: #IC0NXQ Signed-off-by: oh-rgx --- sdk/api/@ohos.buffer.ets | 8 ++++---- sdk/api/@ohos.url.ets | 8 ++++---- sdk/api/@ohos.util.ets | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sdk/api/@ohos.buffer.ets b/sdk/api/@ohos.buffer.ets index a2b9653d..b204f7c3 100644 --- a/sdk/api/@ohos.buffer.ets +++ b/sdk/api/@ohos.buffer.ets @@ -947,8 +947,8 @@ export namespace buffer { let val: number = 0; let multiplier = 1 << (8 * (byteLength - 1)); for (let i = 0; i < byteLength; i++) { - const byte = view.getUint8(offset + i); - val += byte * multiplier; + const byte_ = view.getUint8(offset + i); + val += byte_ * multiplier; multiplier >>= 8; } const signBit = 1 << (8 * byteLength - 1); @@ -992,8 +992,8 @@ export namespace buffer { let val: number = 0; let multiplier = 1; for (let i = 0; i < byteLength; i++) { - const byte = view.getUint8(offset + i); - val += byte * multiplier; + const byte_ = view.getUint8(offset + i); + val += byte_ * multiplier; multiplier <<= 8; } if (val >= (1 << (8 * byteLength - 1))) { diff --git a/sdk/api/@ohos.url.ets b/sdk/api/@ohos.url.ets index 6c55a6ec..1427f00d 100644 --- a/sdk/api/@ohos.url.ets +++ b/sdk/api/@ohos.url.ets @@ -209,12 +209,12 @@ export namespace url { return res; } - function isAlpha(char: string): boolean { - return char.length == 1 && ((char[0] >= c'a' && char[0] <= c'z') || (char[0] >= c'A' && char[0] <= c'Z')); + function isAlpha(ch: string): boolean { + return ch.length == 1 && ((ch[0] >= c'a' && ch[0] <= c'z') || (ch[0] >= c'A' && ch[0] <= c'Z')); } - function isNum(char: string): boolean { - return char.length == 1 && (char[0] >= c'0' && char[0] <= c'9'); + function isNum(ch: string): boolean { + return ch.length == 1 && (ch[0] >= c'0' && ch[0] <= c'9'); } function isAlphaNum(ch: string): boolean { diff --git a/sdk/api/@ohos.util.ets b/sdk/api/@ohos.util.ets index 739669c9..d86c5fe9 100644 --- a/sdk/api/@ohos.util.ets +++ b/sdk/api/@ohos.util.ets @@ -360,11 +360,11 @@ export namespace util { let bytes: Array = new Array(); for (let i = 0; i < cleaned.length; i++) { - let char: string = cleaned[i]; - if (char == "=") { + let ch: string = cleaned[i]; + if (ch == "=") { break; } - let index: int = table.indexOf(char) as int; + let index: int = table.indexOf(ch) as int; if (index == -1) { continue; } -- Gitee