From c63de15a992d37f0d6cec03ac7631872838602cb Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 25 Sep 2025 23:11:16 +0000 Subject: [PATCH] Bump version to 5.9.3 and LKG --- lib/_tsc.js | 36 ++++++++++++++++++---- lib/lib.esnext.float16.d.ts | 2 ++ lib/typescript.d.ts | 1 - lib/typescript.js | 59 ++++++++++++++++++++++++++----------- package-lock.json | 4 +-- package.json | 2 +- src/compiler/corePublic.ts | 2 +- 7 files changed, 78 insertions(+), 28 deletions(-) diff --git a/lib/_tsc.js b/lib/_tsc.js index 11ab5ff444e..612a1f7eed0 100644 --- a/lib/_tsc.js +++ b/lib/_tsc.js @@ -18,7 +18,7 @@ and limitations under the License. // src/compiler/corePublic.ts var versionMajorMinor = "5.9"; -var version = "5.9.2"; +var version = "5.9.3"; // src/compiler/core.ts var emptyArray = []; @@ -20254,10 +20254,22 @@ function createParenthesizerRules(factory2) { } return parenthesizerRule; } + function mixingBinaryOperatorsRequiresParentheses(a, b) { + if (a === 61 /* QuestionQuestionToken */) { + return b === 56 /* AmpersandAmpersandToken */ || b === 57 /* BarBarToken */; + } + if (b === 61 /* QuestionQuestionToken */) { + return a === 56 /* AmpersandAmpersandToken */ || a === 57 /* BarBarToken */; + } + return false; + } function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + const emittedOperand = skipPartiallyEmittedExpressions(operand); + if (isBinaryExpression(emittedOperand) && mixingBinaryOperatorsRequiresParentheses(binaryOperator, emittedOperand.operatorToken.kind)) { + return true; + } const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator); const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator); - const emittedOperand = skipPartiallyEmittedExpressions(operand); if (!isLeftSideOfBinary && operand.kind === 220 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { return true; } @@ -53296,7 +53308,22 @@ function createTypeChecker(host) { function getPropertyNameNodeForSymbol(symbol, context) { const hashPrivateName = getClonedHashPrivateName(symbol); if (hashPrivateName) { - return hashPrivateName; + const shouldEmitErroneousFieldName = !!context.tracker.reportPrivateInBaseOfClassExpression && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */; + if (!shouldEmitErroneousFieldName) { + return hashPrivateName; + } else { + let rawName2 = unescapeLeadingUnderscores(symbol.escapedName); + rawName2 = rawName2.replace(/__#\d+@#/g, "__#private@#"); + return createPropertyNameNodeForIdentifierOrLiteral( + rawName2, + getEmitScriptTarget(compilerOptions), + /*singleQuote*/ + false, + /*stringNamed*/ + true, + !!(symbol.flags & 8192 /* Method */) + ); + } } const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed); const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed); @@ -124188,10 +124215,9 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi } const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames())); commandLine.fileNames.forEach((fileName) => { - if (isDeclarationFileName(fileName)) return; const path = toPath3(fileName); let outputDts; - if (!fileExtensionIs(fileName, ".json" /* Json */)) { + if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) { if (!commandLine.options.outFile) { outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3); mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName }); diff --git a/lib/lib.esnext.float16.d.ts b/lib/lib.esnext.float16.d.ts index 7062792dce7..33bb5516332 100644 --- a/lib/lib.esnext.float16.d.ts +++ b/lib/lib.esnext.float16.d.ts @@ -374,6 +374,8 @@ interface Float16ArrayConstructor { new (length?: number): Float16Array; new (array: ArrayLike | Iterable): Float16Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Float16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float16Array; + new (array: ArrayLike | ArrayBuffer): Float16Array; /** * The size in bytes of each element in the array. diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 87942520f2a..2c56042e22d 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -5907,7 +5907,6 @@ declare namespace ts { */ interface SourceFileLike { readonly text: string; - languageVariant?: LanguageVariant; } interface SourceFileLike { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; diff --git a/lib/typescript.js b/lib/typescript.js index 2643aa12aa6..0554fc3fc70 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports); // src/compiler/corePublic.ts var versionMajorMinor = "5.9"; -var version = "5.9.2"; +var version = "5.9.3"; var Comparison = /* @__PURE__ */ ((Comparison3) => { Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; @@ -6790,10 +6790,10 @@ var ScriptTarget = /* @__PURE__ */ ((ScriptTarget12) => { ScriptTarget12[ScriptTarget12["Latest"] = 99 /* ESNext */] = "Latest"; return ScriptTarget12; })(ScriptTarget || {}); -var LanguageVariant = /* @__PURE__ */ ((LanguageVariant3) => { - LanguageVariant3[LanguageVariant3["Standard"] = 0] = "Standard"; - LanguageVariant3[LanguageVariant3["JSX"] = 1] = "JSX"; - return LanguageVariant3; +var LanguageVariant = /* @__PURE__ */ ((LanguageVariant4) => { + LanguageVariant4[LanguageVariant4["Standard"] = 0] = "Standard"; + LanguageVariant4[LanguageVariant4["JSX"] = 1] = "JSX"; + return LanguageVariant4; })(LanguageVariant || {}); var WatchDirectoryFlags = /* @__PURE__ */ ((WatchDirectoryFlags3) => { WatchDirectoryFlags3[WatchDirectoryFlags3["None"] = 0] = "None"; @@ -24351,10 +24351,22 @@ function createParenthesizerRules(factory2) { } return parenthesizerRule; } + function mixingBinaryOperatorsRequiresParentheses(a, b) { + if (a === 61 /* QuestionQuestionToken */) { + return b === 56 /* AmpersandAmpersandToken */ || b === 57 /* BarBarToken */; + } + if (b === 61 /* QuestionQuestionToken */) { + return a === 56 /* AmpersandAmpersandToken */ || a === 57 /* BarBarToken */; + } + return false; + } function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + const emittedOperand = skipPartiallyEmittedExpressions(operand); + if (isBinaryExpression(emittedOperand) && mixingBinaryOperatorsRequiresParentheses(binaryOperator, emittedOperand.operatorToken.kind)) { + return true; + } const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator); const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator); - const emittedOperand = skipPartiallyEmittedExpressions(operand); if (!isLeftSideOfBinary && operand.kind === 220 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { return true; } @@ -57907,7 +57919,22 @@ function createTypeChecker(host) { function getPropertyNameNodeForSymbol(symbol, context) { const hashPrivateName = getClonedHashPrivateName(symbol); if (hashPrivateName) { - return hashPrivateName; + const shouldEmitErroneousFieldName = !!context.tracker.reportPrivateInBaseOfClassExpression && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */; + if (!shouldEmitErroneousFieldName) { + return hashPrivateName; + } else { + let rawName2 = unescapeLeadingUnderscores(symbol.escapedName); + rawName2 = rawName2.replace(/__#\d+@#/g, "__#private@#"); + return createPropertyNameNodeForIdentifierOrLiteral( + rawName2, + getEmitScriptTarget(compilerOptions), + /*singleQuote*/ + false, + /*stringNamed*/ + true, + !!(symbol.flags & 8192 /* Method */) + ); + } } const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed); const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed); @@ -129038,10 +129065,9 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi } const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames())); commandLine.fileNames.forEach((fileName) => { - if (isDeclarationFileName(fileName)) return; const path = toPath3(fileName); let outputDts; - if (!fileExtensionIs(fileName, ".json" /* Json */)) { + if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) { if (!commandLine.options.outFile) { outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3); mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName }); @@ -140403,7 +140429,7 @@ function isInsideJsxElementOrAttribute(sourceFile, position) { if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 295 /* JsxExpression */) { return true; } - if (token.kind === 31 /* LessThanSlashToken */ && token.parent.kind === 288 /* JsxClosingElement */) { + if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 288 /* JsxClosingElement */) { return true; } return false; @@ -140431,7 +140457,7 @@ function isInJSXText(sourceFile, position) { function isInsideJsxElement(sourceFile, position) { function isInsideJsxElementTraversal(node) { while (node) { - if (node.kind >= 286 /* JsxSelfClosingElement */ && node.kind <= 295 /* JsxExpression */ || node.kind === 12 /* JsxText */ || node.kind === 30 /* LessThanToken */ || node.kind === 32 /* GreaterThanToken */ || node.kind === 80 /* Identifier */ || node.kind === 20 /* CloseBraceToken */ || node.kind === 19 /* OpenBraceToken */ || node.kind === 44 /* SlashToken */ || node.kind === 31 /* LessThanSlashToken */) { + if (node.kind >= 286 /* JsxSelfClosingElement */ && node.kind <= 295 /* JsxExpression */ || node.kind === 12 /* JsxText */ || node.kind === 30 /* LessThanToken */ || node.kind === 32 /* GreaterThanToken */ || node.kind === 80 /* Identifier */ || node.kind === 20 /* CloseBraceToken */ || node.kind === 19 /* OpenBraceToken */ || node.kind === 44 /* SlashToken */) { node = node.parent; } else if (node.kind === 285 /* JsxElement */) { if (position > node.getStart(sourceFile)) return true; @@ -151873,9 +151899,7 @@ function createChildren(node, sourceFile) { }); return children; } - const languageVariant = (sourceFile == null ? void 0 : sourceFile.languageVariant) ?? 0 /* Standard */; scanner.setText((sourceFile || node.getSourceFile()).text); - scanner.setLanguageVariant(languageVariant); let pos = node.pos; const processNode = (child) => { addSyntheticNodes(children, pos, child.pos, node); @@ -151892,7 +151916,6 @@ function createChildren(node, sourceFile) { node.forEachChild(processNode, processNodes); addSyntheticNodes(children, pos, node.end, node); scanner.setText(void 0); - scanner.setLanguageVariant(0 /* Standard */); return children; } function addSyntheticNodes(nodes, pos, end, parent2) { @@ -167606,7 +167629,7 @@ function getJsxClosingTagCompletion(location, sourceFile) { switch (node.kind) { case 288 /* JsxClosingElement */: return true; - case 31 /* LessThanSlashToken */: + case 44 /* SlashToken */: case 32 /* GreaterThanToken */: case 80 /* Identifier */: case 212 /* PropertyAccessExpression */: @@ -168942,7 +168965,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, location = currentToken; } break; - case 31 /* LessThanSlashToken */: + case 44 /* SlashToken */: if (currentToken.parent.kind === 286 /* JsxSelfClosingElement */) { location = currentToken; } @@ -168951,7 +168974,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position, } switch (parent2.kind) { case 288 /* JsxClosingElement */: - if (contextToken.kind === 31 /* LessThanSlashToken */) { + if (contextToken.kind === 44 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } @@ -170572,7 +170595,7 @@ function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) { case "<": return !!contextToken && contextToken.kind === 30 /* LessThanToken */ && (!isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent)); case "/": - return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 31 /* LessThanSlashToken */ && isJsxClosingElement(contextToken.parent)); + return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 44 /* SlashToken */ && isJsxClosingElement(contextToken.parent)); case " ": return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 308 /* SourceFile */; default: diff --git a/package-lock.json b/package-lock.json index 14fa0eca972..53fc39177b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "typescript", - "version": "5.9.2", + "version": "5.9.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "typescript", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index 22a9e79564f..f7f35370bc8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts index 9c1447c9c6f..23888726d28 100644 --- a/src/compiler/corePublic.ts +++ b/src/compiler/corePublic.ts @@ -3,7 +3,7 @@ export const versionMajorMinor = "5.9"; // The following is baselined as a literal template type without intervention /** The version of the TypeScript compiler release */ -export const version = "5.9.2" as string; +export const version = "5.9.3" as string; /** * Type of objects whose values are all of the same type.