Skip to content

Commit c63de15

Browse files
Bump version to 5.9.3 and LKG
1 parent 8428ca4 commit c63de15

File tree

7 files changed

+78
-28
lines changed

7 files changed

+78
-28
lines changed

lib/_tsc.js

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and limitations under the License.
1818

1919
// src/compiler/corePublic.ts
2020
var versionMajorMinor = "5.9";
21-
var version = "5.9.2";
21+
var version = "5.9.3";
2222

2323
// src/compiler/core.ts
2424
var emptyArray = [];
@@ -20254,10 +20254,22 @@ function createParenthesizerRules(factory2) {
2025420254
}
2025520255
return parenthesizerRule;
2025620256
}
20257+
function mixingBinaryOperatorsRequiresParentheses(a, b) {
20258+
if (a === 61 /* QuestionQuestionToken */) {
20259+
return b === 56 /* AmpersandAmpersandToken */ || b === 57 /* BarBarToken */;
20260+
}
20261+
if (b === 61 /* QuestionQuestionToken */) {
20262+
return a === 56 /* AmpersandAmpersandToken */ || a === 57 /* BarBarToken */;
20263+
}
20264+
return false;
20265+
}
2025720266
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
20267+
const emittedOperand = skipPartiallyEmittedExpressions(operand);
20268+
if (isBinaryExpression(emittedOperand) && mixingBinaryOperatorsRequiresParentheses(binaryOperator, emittedOperand.operatorToken.kind)) {
20269+
return true;
20270+
}
2025820271
const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator);
2025920272
const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator);
20260-
const emittedOperand = skipPartiallyEmittedExpressions(operand);
2026120273
if (!isLeftSideOfBinary && operand.kind === 220 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
2026220274
return true;
2026320275
}
@@ -53296,7 +53308,22 @@ function createTypeChecker(host) {
5329653308
function getPropertyNameNodeForSymbol(symbol, context) {
5329753309
const hashPrivateName = getClonedHashPrivateName(symbol);
5329853310
if (hashPrivateName) {
53299-
return hashPrivateName;
53311+
const shouldEmitErroneousFieldName = !!context.tracker.reportPrivateInBaseOfClassExpression && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */;
53312+
if (!shouldEmitErroneousFieldName) {
53313+
return hashPrivateName;
53314+
} else {
53315+
let rawName2 = unescapeLeadingUnderscores(symbol.escapedName);
53316+
rawName2 = rawName2.replace(/__#\d+@#/g, "__#private@#");
53317+
return createPropertyNameNodeForIdentifierOrLiteral(
53318+
rawName2,
53319+
getEmitScriptTarget(compilerOptions),
53320+
/*singleQuote*/
53321+
false,
53322+
/*stringNamed*/
53323+
true,
53324+
!!(symbol.flags & 8192 /* Method */)
53325+
);
53326+
}
5330053327
}
5330153328
const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed);
5330253329
const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed);
@@ -124188,10 +124215,9 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
124188124215
}
124189124216
const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
124190124217
commandLine.fileNames.forEach((fileName) => {
124191-
if (isDeclarationFileName(fileName)) return;
124192124218
const path = toPath3(fileName);
124193124219
let outputDts;
124194-
if (!fileExtensionIs(fileName, ".json" /* Json */)) {
124220+
if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) {
124195124221
if (!commandLine.options.outFile) {
124196124222
outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3);
124197124223
mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName });

lib/lib.esnext.float16.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ interface Float16ArrayConstructor {
374374
new (length?: number): Float16Array<ArrayBuffer>;
375375
new (array: ArrayLike<number> | Iterable<number>): Float16Array<ArrayBuffer>;
376376
new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Float16Array<TArrayBuffer>;
377+
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float16Array<ArrayBuffer>;
378+
new (array: ArrayLike<number> | ArrayBuffer): Float16Array<ArrayBuffer>;
377379

378380
/**
379381
* The size in bytes of each element in the array.

lib/typescript.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5907,7 +5907,6 @@ declare namespace ts {
59075907
*/
59085908
interface SourceFileLike {
59095909
readonly text: string;
5910-
languageVariant?: LanguageVariant;
59115910
}
59125911
interface SourceFileLike {
59135912
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;

lib/typescript.js

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
22852285

22862286
// src/compiler/corePublic.ts
22872287
var versionMajorMinor = "5.9";
2288-
var version = "5.9.2";
2288+
var version = "5.9.3";
22892289
var Comparison = /* @__PURE__ */ ((Comparison3) => {
22902290
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
22912291
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6790,10 +6790,10 @@ var ScriptTarget = /* @__PURE__ */ ((ScriptTarget12) => {
67906790
ScriptTarget12[ScriptTarget12["Latest"] = 99 /* ESNext */] = "Latest";
67916791
return ScriptTarget12;
67926792
})(ScriptTarget || {});
6793-
var LanguageVariant = /* @__PURE__ */ ((LanguageVariant3) => {
6794-
LanguageVariant3[LanguageVariant3["Standard"] = 0] = "Standard";
6795-
LanguageVariant3[LanguageVariant3["JSX"] = 1] = "JSX";
6796-
return LanguageVariant3;
6793+
var LanguageVariant = /* @__PURE__ */ ((LanguageVariant4) => {
6794+
LanguageVariant4[LanguageVariant4["Standard"] = 0] = "Standard";
6795+
LanguageVariant4[LanguageVariant4["JSX"] = 1] = "JSX";
6796+
return LanguageVariant4;
67976797
})(LanguageVariant || {});
67986798
var WatchDirectoryFlags = /* @__PURE__ */ ((WatchDirectoryFlags3) => {
67996799
WatchDirectoryFlags3[WatchDirectoryFlags3["None"] = 0] = "None";
@@ -24351,10 +24351,22 @@ function createParenthesizerRules(factory2) {
2435124351
}
2435224352
return parenthesizerRule;
2435324353
}
24354+
function mixingBinaryOperatorsRequiresParentheses(a, b) {
24355+
if (a === 61 /* QuestionQuestionToken */) {
24356+
return b === 56 /* AmpersandAmpersandToken */ || b === 57 /* BarBarToken */;
24357+
}
24358+
if (b === 61 /* QuestionQuestionToken */) {
24359+
return a === 56 /* AmpersandAmpersandToken */ || a === 57 /* BarBarToken */;
24360+
}
24361+
return false;
24362+
}
2435424363
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
24364+
const emittedOperand = skipPartiallyEmittedExpressions(operand);
24365+
if (isBinaryExpression(emittedOperand) && mixingBinaryOperatorsRequiresParentheses(binaryOperator, emittedOperand.operatorToken.kind)) {
24366+
return true;
24367+
}
2435524368
const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator);
2435624369
const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator);
24357-
const emittedOperand = skipPartiallyEmittedExpressions(operand);
2435824370
if (!isLeftSideOfBinary && operand.kind === 220 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) {
2435924371
return true;
2436024372
}
@@ -57907,7 +57919,22 @@ function createTypeChecker(host) {
5790757919
function getPropertyNameNodeForSymbol(symbol, context) {
5790857920
const hashPrivateName = getClonedHashPrivateName(symbol);
5790957921
if (hashPrivateName) {
57910-
return hashPrivateName;
57922+
const shouldEmitErroneousFieldName = !!context.tracker.reportPrivateInBaseOfClassExpression && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */;
57923+
if (!shouldEmitErroneousFieldName) {
57924+
return hashPrivateName;
57925+
} else {
57926+
let rawName2 = unescapeLeadingUnderscores(symbol.escapedName);
57927+
rawName2 = rawName2.replace(/__#\d+@#/g, "__#private@#");
57928+
return createPropertyNameNodeForIdentifierOrLiteral(
57929+
rawName2,
57930+
getEmitScriptTarget(compilerOptions),
57931+
/*singleQuote*/
57932+
false,
57933+
/*stringNamed*/
57934+
true,
57935+
!!(symbol.flags & 8192 /* Method */)
57936+
);
57937+
}
5791157938
}
5791257939
const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed);
5791357940
const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed);
@@ -129038,10 +129065,9 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
129038129065
}
129039129066
const getCommonSourceDirectory3 = memoize(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()));
129040129067
commandLine.fileNames.forEach((fileName) => {
129041-
if (isDeclarationFileName(fileName)) return;
129042129068
const path = toPath3(fileName);
129043129069
let outputDts;
129044-
if (!fileExtensionIs(fileName, ".json" /* Json */)) {
129070+
if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, ".json" /* Json */)) {
129045129071
if (!commandLine.options.outFile) {
129046129072
outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3);
129047129073
mapOutputFileToResolvedRef.set(toPath3(outputDts), { resolvedRef, source: fileName });
@@ -140403,7 +140429,7 @@ function isInsideJsxElementOrAttribute(sourceFile, position) {
140403140429
if (token && token.kind === 20 /* CloseBraceToken */ && token.parent.kind === 295 /* JsxExpression */) {
140404140430
return true;
140405140431
}
140406-
if (token.kind === 31 /* LessThanSlashToken */ && token.parent.kind === 288 /* JsxClosingElement */) {
140432+
if (token.kind === 30 /* LessThanToken */ && token.parent.kind === 288 /* JsxClosingElement */) {
140407140433
return true;
140408140434
}
140409140435
return false;
@@ -140431,7 +140457,7 @@ function isInJSXText(sourceFile, position) {
140431140457
function isInsideJsxElement(sourceFile, position) {
140432140458
function isInsideJsxElementTraversal(node) {
140433140459
while (node) {
140434-
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 */) {
140460+
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 */) {
140435140461
node = node.parent;
140436140462
} else if (node.kind === 285 /* JsxElement */) {
140437140463
if (position > node.getStart(sourceFile)) return true;
@@ -151873,9 +151899,7 @@ function createChildren(node, sourceFile) {
151873151899
});
151874151900
return children;
151875151901
}
151876-
const languageVariant = (sourceFile == null ? void 0 : sourceFile.languageVariant) ?? 0 /* Standard */;
151877151902
scanner.setText((sourceFile || node.getSourceFile()).text);
151878-
scanner.setLanguageVariant(languageVariant);
151879151903
let pos = node.pos;
151880151904
const processNode = (child) => {
151881151905
addSyntheticNodes(children, pos, child.pos, node);
@@ -151892,7 +151916,6 @@ function createChildren(node, sourceFile) {
151892151916
node.forEachChild(processNode, processNodes);
151893151917
addSyntheticNodes(children, pos, node.end, node);
151894151918
scanner.setText(void 0);
151895-
scanner.setLanguageVariant(0 /* Standard */);
151896151919
return children;
151897151920
}
151898151921
function addSyntheticNodes(nodes, pos, end, parent2) {
@@ -167606,7 +167629,7 @@ function getJsxClosingTagCompletion(location, sourceFile) {
167606167629
switch (node.kind) {
167607167630
case 288 /* JsxClosingElement */:
167608167631
return true;
167609-
case 31 /* LessThanSlashToken */:
167632+
case 44 /* SlashToken */:
167610167633
case 32 /* GreaterThanToken */:
167611167634
case 80 /* Identifier */:
167612167635
case 212 /* PropertyAccessExpression */:
@@ -168942,7 +168965,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
168942168965
location = currentToken;
168943168966
}
168944168967
break;
168945-
case 31 /* LessThanSlashToken */:
168968+
case 44 /* SlashToken */:
168946168969
if (currentToken.parent.kind === 286 /* JsxSelfClosingElement */) {
168947168970
location = currentToken;
168948168971
}
@@ -168951,7 +168974,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
168951168974
}
168952168975
switch (parent2.kind) {
168953168976
case 288 /* JsxClosingElement */:
168954-
if (contextToken.kind === 31 /* LessThanSlashToken */) {
168977+
if (contextToken.kind === 44 /* SlashToken */) {
168955168978
isStartingCloseTag = true;
168956168979
location = contextToken;
168957168980
}
@@ -170572,7 +170595,7 @@ function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) {
170572170595
case "<":
170573170596
return !!contextToken && contextToken.kind === 30 /* LessThanToken */ && (!isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent));
170574170597
case "/":
170575-
return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 31 /* LessThanSlashToken */ && isJsxClosingElement(contextToken.parent));
170598+
return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 44 /* SlashToken */ && isJsxClosingElement(contextToken.parent));
170576170599
case " ":
170577170600
return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 308 /* SourceFile */;
170578170601
default:

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "https://www.typescriptlang.org/",
5-
"version": "5.9.2",
5+
"version": "5.9.3",
66
"license": "Apache-2.0",
77
"description": "TypeScript is a language for application scale JavaScript development",
88
"keywords": [

src/compiler/corePublic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
export const versionMajorMinor = "5.9";
44
// The following is baselined as a literal template type without intervention
55
/** The version of the TypeScript compiler release */
6-
export const version = "5.9.2" as string;
6+
export const version = "5.9.3" as string;
77

88
/**
99
* Type of objects whose values are all of the same type.

0 commit comments

Comments
 (0)