typescript 4.6.0-dev.20211126 → 4.6.0-dev.20211130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +56 -15
- package/lib/tsserver.js +158 -91
- package/lib/tsserverlibrary.js +158 -91
- package/lib/typescript.js +158 -91
- package/lib/typescriptServices.js +158 -91
- package/lib/typingsInstaller.js +66 -18
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211130";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -90899,11 +90899,10 @@ var ts;
|
|
|
90899
90899
|
// we can safely elide the parentheses here, as a new synthetic
|
|
90900
90900
|
// ParenthesizedExpression will be inserted if we remove parentheses too
|
|
90901
90901
|
// aggressively.
|
|
90902
|
-
//
|
|
90903
|
-
//
|
|
90904
|
-
|
|
90905
|
-
|
|
90906
|
-
}
|
|
90902
|
+
//
|
|
90903
|
+
// If there are leading comments on the expression itself, the emitter will handle ASI
|
|
90904
|
+
// for return, throw, and yield by re-introducing parenthesis during emit on an as-need
|
|
90905
|
+
// basis.
|
|
90907
90906
|
return factory.createPartiallyEmittedExpression(expression, node);
|
|
90908
90907
|
}
|
|
90909
90908
|
return ts.visitEachChild(node, visitor, context);
|
|
@@ -94851,11 +94850,11 @@ var ts;
|
|
|
94851
94850
|
}
|
|
94852
94851
|
function visitOptionalExpression(node, captureThisArg, isDelete) {
|
|
94853
94852
|
var _a = flattenChain(node), expression = _a.expression, chain = _a.chain;
|
|
94854
|
-
var left = visitNonOptionalExpression(expression, ts.isCallChain(chain[0]), /*isDelete*/ false);
|
|
94853
|
+
var left = visitNonOptionalExpression(ts.skipPartiallyEmittedExpressions(expression), ts.isCallChain(chain[0]), /*isDelete*/ false);
|
|
94855
94854
|
var leftThisArg = ts.isSyntheticReference(left) ? left.thisArg : undefined;
|
|
94856
|
-
var
|
|
94857
|
-
var
|
|
94858
|
-
if (!ts.isSimpleCopiableExpression(
|
|
94855
|
+
var capturedLeft = ts.isSyntheticReference(left) ? left.expression : left;
|
|
94856
|
+
var leftExpression = factory.restoreOuterExpressions(expression, capturedLeft, 8 /* PartiallyEmittedExpressions */);
|
|
94857
|
+
if (!ts.isSimpleCopiableExpression(capturedLeft)) {
|
|
94859
94858
|
capturedLeft = factory.createTempVariable(hoistVariableDeclaration);
|
|
94860
94859
|
leftExpression = factory.createAssignment(capturedLeft, leftExpression);
|
|
94861
94860
|
}
|
|
@@ -94881,6 +94880,10 @@ var ts;
|
|
|
94881
94880
|
break;
|
|
94882
94881
|
case 207 /* CallExpression */:
|
|
94883
94882
|
if (i === 0 && leftThisArg) {
|
|
94883
|
+
if (!ts.isGeneratedIdentifier(leftThisArg)) {
|
|
94884
|
+
leftThisArg = factory.cloneNode(leftThisArg);
|
|
94885
|
+
ts.addEmitFlags(leftThisArg, 1536 /* NoComments */);
|
|
94886
|
+
}
|
|
94884
94887
|
rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 106 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression));
|
|
94885
94888
|
}
|
|
94886
94889
|
else {
|
|
@@ -109663,7 +109666,7 @@ var ts;
|
|
|
109663
109666
|
function emitYieldExpression(node) {
|
|
109664
109667
|
emitTokenWithComment(125 /* YieldKeyword */, node.pos, writeKeyword, node);
|
|
109665
109668
|
emit(node.asteriskToken);
|
|
109666
|
-
emitExpressionWithLeadingSpace(node.expression
|
|
109669
|
+
emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsiAndDisallowedComma);
|
|
109667
109670
|
}
|
|
109668
109671
|
function emitSpreadElement(node) {
|
|
109669
109672
|
emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node);
|
|
@@ -109860,9 +109863,49 @@ var ts;
|
|
|
109860
109863
|
}
|
|
109861
109864
|
return pos;
|
|
109862
109865
|
}
|
|
109866
|
+
function commentWillEmitNewLine(node) {
|
|
109867
|
+
return node.kind === 2 /* SingleLineCommentTrivia */ || !!node.hasTrailingNewLine;
|
|
109868
|
+
}
|
|
109869
|
+
function willEmitLeadingNewLine(node) {
|
|
109870
|
+
if (!currentSourceFile)
|
|
109871
|
+
return false;
|
|
109872
|
+
if (ts.some(ts.getLeadingCommentRanges(currentSourceFile.text, node.pos), commentWillEmitNewLine))
|
|
109873
|
+
return true;
|
|
109874
|
+
if (ts.some(ts.getSyntheticLeadingComments(node), commentWillEmitNewLine))
|
|
109875
|
+
return true;
|
|
109876
|
+
if (ts.isPartiallyEmittedExpression(node)) {
|
|
109877
|
+
if (node.pos !== node.expression.pos) {
|
|
109878
|
+
if (ts.some(ts.getTrailingCommentRanges(currentSourceFile.text, node.expression.pos), commentWillEmitNewLine))
|
|
109879
|
+
return true;
|
|
109880
|
+
}
|
|
109881
|
+
return willEmitLeadingNewLine(node.expression);
|
|
109882
|
+
}
|
|
109883
|
+
return false;
|
|
109884
|
+
}
|
|
109885
|
+
/**
|
|
109886
|
+
* Wraps an expression in parens if we would emit a leading comment that would introduce a line separator
|
|
109887
|
+
* between the node and its parent.
|
|
109888
|
+
*/
|
|
109889
|
+
function parenthesizeExpressionForNoAsi(node) {
|
|
109890
|
+
if (!commentsDisabled && ts.isPartiallyEmittedExpression(node) && willEmitLeadingNewLine(node)) {
|
|
109891
|
+
var parseNode = ts.getParseTreeNode(node);
|
|
109892
|
+
if (parseNode && ts.isParenthesizedExpression(parseNode)) {
|
|
109893
|
+
// If the original node was a parenthesized expression, restore it to preserve comment and source map emit
|
|
109894
|
+
var parens = ts.factory.createParenthesizedExpression(node.expression);
|
|
109895
|
+
ts.setOriginalNode(parens, node);
|
|
109896
|
+
ts.setTextRange(parens, parseNode);
|
|
109897
|
+
return parens;
|
|
109898
|
+
}
|
|
109899
|
+
return ts.factory.createParenthesizedExpression(node);
|
|
109900
|
+
}
|
|
109901
|
+
return node;
|
|
109902
|
+
}
|
|
109903
|
+
function parenthesizeExpressionForNoAsiAndDisallowedComma(node) {
|
|
109904
|
+
return parenthesizeExpressionForNoAsi(parenthesizer.parenthesizeExpressionForDisallowedComma(node));
|
|
109905
|
+
}
|
|
109863
109906
|
function emitReturnStatement(node) {
|
|
109864
109907
|
emitTokenWithComment(105 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node);
|
|
109865
|
-
emitExpressionWithLeadingSpace(node.expression);
|
|
109908
|
+
emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi);
|
|
109866
109909
|
writeTrailingSemicolon();
|
|
109867
109910
|
}
|
|
109868
109911
|
function emitWithStatement(node) {
|
|
@@ -109890,7 +109933,7 @@ var ts;
|
|
|
109890
109933
|
}
|
|
109891
109934
|
function emitThrowStatement(node) {
|
|
109892
109935
|
emitTokenWithComment(109 /* ThrowKeyword */, node.pos, writeKeyword, node);
|
|
109893
|
-
emitExpressionWithLeadingSpace(node.expression);
|
|
109936
|
+
emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi);
|
|
109894
109937
|
writeTrailingSemicolon();
|
|
109895
109938
|
}
|
|
109896
109939
|
function emitTryStatement(node) {
|
|
@@ -110734,7 +110777,14 @@ var ts;
|
|
|
110734
110777
|
}
|
|
110735
110778
|
// Transformation nodes
|
|
110736
110779
|
function emitPartiallyEmittedExpression(node) {
|
|
110780
|
+
var emitFlags = ts.getEmitFlags(node);
|
|
110781
|
+
if (!(emitFlags & 512 /* NoLeadingComments */) && node.pos !== node.expression.pos) {
|
|
110782
|
+
emitTrailingCommentsOfPosition(node.expression.pos);
|
|
110783
|
+
}
|
|
110737
110784
|
emitExpression(node.expression);
|
|
110785
|
+
if (!(emitFlags & 1024 /* NoTrailingComments */) && node.end !== node.expression.end) {
|
|
110786
|
+
emitLeadingCommentsOfPosition(node.expression.end);
|
|
110787
|
+
}
|
|
110738
110788
|
}
|
|
110739
110789
|
function emitCommaList(node) {
|
|
110740
110790
|
emitExpressionList(node, node.elements, 528 /* CommaListElements */, /*parenthesizerRule*/ undefined);
|
|
@@ -111098,10 +111148,8 @@ var ts;
|
|
|
111098
111148
|
// Emit this child.
|
|
111099
111149
|
previousSourceFileTextKind = recordBundleFileInternalSectionStart(child);
|
|
111100
111150
|
if (shouldEmitInterveningComments) {
|
|
111101
|
-
|
|
111102
|
-
|
|
111103
|
-
emitTrailingCommentsOfPosition(commentRange.pos);
|
|
111104
|
-
}
|
|
111151
|
+
var commentRange = ts.getCommentRange(child);
|
|
111152
|
+
emitTrailingCommentsOfPosition(commentRange.pos);
|
|
111105
111153
|
}
|
|
111106
111154
|
else {
|
|
111107
111155
|
shouldEmitInterveningComments = mayEmitInterveningComments;
|
|
@@ -111422,7 +111470,7 @@ var ts;
|
|
|
111422
111470
|
function writeLineSeparatorsAndIndentBefore(node, parent) {
|
|
111423
111471
|
var leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent, [node], 0 /* None */);
|
|
111424
111472
|
if (leadingNewlines) {
|
|
111425
|
-
writeLinesAndIndent(leadingNewlines, /*
|
|
111473
|
+
writeLinesAndIndent(leadingNewlines, /*writeSpaceIfNotIndenting*/ false);
|
|
111426
111474
|
}
|
|
111427
111475
|
return !!leadingNewlines;
|
|
111428
111476
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.6.0-dev.
|
|
5
|
+
"version": "4.6.0-dev.20211130",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|