@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
22852285
22862286// src/compiler/corePublic.ts
22872287var versionMajorMinor = "5.9";
2288- var version = "5.9.2 ";
2288+ var version = "5.9.3 ";
22892289var 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 || {});
67986798var 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) {
140431140457function 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}
151898151921function 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:
0 commit comments