From 5318ed12c6da6053d39a433a023623bf5e35e168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Heredia=20Montiel?= Date: Thu, 12 Sep 2024 22:09:09 -0600 Subject: [PATCH] =?UTF-8?q?typescript:=204.7.4=20=E2=86=92=205.5.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NOTICE | 1 + package-lock.json | 17 +++++++++-------- package.json | 2 +- src/builtins.ts | 2 ++ src/tokenizer.ts | 3 +++ tests/compiler/std/string-encoding.ts | 2 +- tests/compiler/std/string.ts | 2 +- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/NOTICE b/NOTICE index adca27c800..aacf76c8e7 100644 --- a/NOTICE +++ b/NOTICE @@ -57,6 +57,7 @@ under the licensing terms detailed in LICENSE: * Bach Le * Xinquan Xu * Matt Johnson-Pint +* Fabián Heredia Montiel Portions of this software are derived from third-party works licensed under the following terms: diff --git a/package-lock.json b/package-lock.json index e4bc84df7e..28afa0645c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "esbuild": "^0.19.4", "eslint": "^8.33.0", "glob": "^10.3.0", - "typescript": "~4.7.4" + "typescript": "^5.5.4" }, "engines": { "node": ">=16", @@ -2273,16 +2273,17 @@ } }, "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/undici-types": { @@ -3924,9 +3925,9 @@ "dev": true }, "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true }, "undici-types": { diff --git a/package.json b/package.json index 4d414afdde..b2a0ee359d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "esbuild": "^0.19.4", "eslint": "^8.33.0", "glob": "^10.3.0", - "typescript": "~4.7.4" + "typescript": "^5.5.4" }, "type": "module", "exports": { diff --git a/src/builtins.ts b/src/builtins.ts index e9f563e1e6..956ab08a2f 100644 --- a/src/builtins.ts +++ b/src/builtins.ts @@ -1623,6 +1623,7 @@ function builtin_max(ctx: BuiltinFunctionContext): ExpressionRef { } else { arg1 = compiler.compileExpression(operands[1], type, Constraints.ConvImplicit | Constraints.MustWrap); } + // @ts-expect-error let op: BinaryOp = -1; switch (type.kind) { case TypeKind.I8: @@ -1691,6 +1692,7 @@ function builtin_min(ctx: BuiltinFunctionContext): ExpressionRef { } else { arg1 = compiler.compileExpression(operands[1], type, Constraints.ConvImplicit | Constraints.MustWrap); } + // @ts-expect-error let op: BinaryOp = -1; switch (type.kind) { case TypeKind.I8: diff --git a/src/tokenizer.ts b/src/tokenizer.ts index a4bf9e9aa4..08a9e10dec 100644 --- a/src/tokenizer.ts +++ b/src/tokenizer.ts @@ -463,9 +463,11 @@ export class Tokenizer extends DiagnosticEmitter { end: i32 = 0; pos: i32 = 0; + // @ts-expect-error token: Token = -1; tokenPos: i32 = 0; + // @ts-expect-error nextToken: Token = -1; nextTokenPos: i32 = 0; nextTokenOnNewLine: OnNewLine = OnNewLine.Unknown; @@ -1055,6 +1057,7 @@ export class Tokenizer extends DiagnosticEmitter { } clearNextToken(): void { + // @ts-expect-error this.nextToken = -1; this.nextTokenPos = 0; this.nextTokenOnNewLine = OnNewLine.Unknown; diff --git a/tests/compiler/std/string-encoding.ts b/tests/compiler/std/string-encoding.ts index b184dc9f0d..7a131280dc 100644 --- a/tests/compiler/std/string-encoding.ts +++ b/tests/compiler/std/string-encoding.ts @@ -118,7 +118,7 @@ testUTF8Decode(); function testUTF8DecodeNullTerminated(): void { var buf = String.UTF8.encode(str, true); assert(String.UTF8.decode(buf, true) == str); - var str2 = "123\0456"; + var str2 = "123\x00456"; assert(String.UTF8.byteLength(str2, true) == 4); var buf2 = String.UTF8.encode(str2, true); assert(buf2.byteLength == 4); diff --git a/tests/compiler/std/string.ts b/tests/compiler/std/string.ts index 3f3e281a4d..7b9281c8e4 100644 --- a/tests/compiler/std/string.ts +++ b/tests/compiler/std/string.ts @@ -27,7 +27,7 @@ assert(String.fromCharCode(65600) == "@"); assert(String.fromCharCode(54) == "6"); assert(String.fromCharCode(0x10000 + 54) == "6"); assert(String.fromCharCode(0xD800, 0xDF00) == "𐌀"); -assert(String.fromCharCodes([0, 54]) == "\06"); +assert(String.fromCharCodes([0, 54]) == "\x006"); assert(String.fromCharCodes([65, 66, 67]) == "ABC"); assert(String.fromCharCodes([0xD834, 0xDF06, 0x61, 0xD834, 0xDF07]) == "\uD834\uDF06a\uD834\uDF07");