typescript 4.9.0-dev.20221017 → 4.9.0-dev.20221019
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/es/diagnosticMessages.generated.json +6 -0
- package/lib/it/diagnosticMessages.generated.json +6 -0
- package/lib/ko/diagnosticMessages.generated.json +6 -0
- package/lib/pt-br/diagnosticMessages.generated.json +6 -0
- package/lib/tsc.js +18 -27
- package/lib/tsserver.js +39 -52
- package/lib/tsserverlibrary.js +39 -52
- package/lib/typescript.js +39 -52
- package/lib/typescriptServices.js +39 -52
- package/lib/typingsInstaller.js +26 -45
- package/lib/zh-cn/diagnosticMessages.generated.json +6 -0
- package/package.json +1 -1
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221019");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -21710,13 +21710,11 @@ var ts;
|
|
|
21710
21710
|
* Creates a `BaseNodeFactory` which can be used to create `Node` instances from the constructors provided by the object allocator.
|
|
21711
21711
|
*/
|
|
21712
21712
|
function createBaseNodeFactory() {
|
|
21713
|
-
// tslint:disable variable-name
|
|
21714
21713
|
var NodeConstructor;
|
|
21715
21714
|
var TokenConstructor;
|
|
21716
21715
|
var IdentifierConstructor;
|
|
21717
21716
|
var PrivateIdentifierConstructor;
|
|
21718
21717
|
var SourceFileConstructor;
|
|
21719
|
-
// tslint:enable variable-name
|
|
21720
21718
|
return {
|
|
21721
21719
|
createBaseSourceFileNode: createBaseSourceFileNode,
|
|
21722
21720
|
createBaseIdentifierNode: createBaseIdentifierNode,
|
|
@@ -27648,11 +27646,9 @@ var ts;
|
|
|
27648
27646
|
rawTextScanner.setText("`" + rawText + "`");
|
|
27649
27647
|
break;
|
|
27650
27648
|
case 15 /* SyntaxKind.TemplateHead */:
|
|
27651
|
-
// tslint:disable-next-line no-invalid-template-strings
|
|
27652
27649
|
rawTextScanner.setText("`" + rawText + "${");
|
|
27653
27650
|
break;
|
|
27654
27651
|
case 16 /* SyntaxKind.TemplateMiddle */:
|
|
27655
|
-
// tslint:disable-next-line no-invalid-template-strings
|
|
27656
27652
|
rawTextScanner.setText("}" + rawText + "${");
|
|
27657
27653
|
break;
|
|
27658
27654
|
case 17 /* SyntaxKind.TemplateTail */:
|
|
@@ -28011,7 +28007,6 @@ var ts;
|
|
|
28011
28007
|
return node;
|
|
28012
28008
|
}
|
|
28013
28009
|
ts.createInputFiles = createInputFiles;
|
|
28014
|
-
// tslint:disable-next-line variable-name
|
|
28015
28010
|
var SourceMapSource;
|
|
28016
28011
|
/**
|
|
28017
28012
|
* Create an external source map source file reference
|
|
@@ -32145,13 +32140,11 @@ var ts;
|
|
|
32145
32140
|
var scanner = ts.createScanner(99 /* ScriptTarget.Latest */, /*skipTrivia*/ true);
|
|
32146
32141
|
var disallowInAndDecoratorContext = 4096 /* NodeFlags.DisallowInContext */ | 16384 /* NodeFlags.DecoratorContext */;
|
|
32147
32142
|
// capture constructors in 'initializeState' to avoid null checks
|
|
32148
|
-
// tslint:disable variable-name
|
|
32149
32143
|
var NodeConstructor;
|
|
32150
32144
|
var TokenConstructor;
|
|
32151
32145
|
var IdentifierConstructor;
|
|
32152
32146
|
var PrivateIdentifierConstructor;
|
|
32153
32147
|
var SourceFileConstructor;
|
|
32154
|
-
// tslint:enable variable-name
|
|
32155
32148
|
function countNode(node) {
|
|
32156
32149
|
nodeCount++;
|
|
32157
32150
|
return node;
|
|
@@ -72121,7 +72114,7 @@ var ts;
|
|
|
72121
72114
|
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
|
|
72122
72115
|
}
|
|
72123
72116
|
else if (expr.kind === 218 /* SyntaxKind.TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
|
|
72124
|
-
type =
|
|
72117
|
+
type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
|
|
72125
72118
|
}
|
|
72126
72119
|
else {
|
|
72127
72120
|
if (strictNullChecks) {
|
|
@@ -72402,7 +72395,7 @@ var ts;
|
|
|
72402
72395
|
!!(prop.flags & 16777216 /* SymbolFlags.Optional */) || assumeTrue :
|
|
72403
72396
|
!!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
|
|
72404
72397
|
}
|
|
72405
|
-
function
|
|
72398
|
+
function narrowTypeByInKeyword(type, nameType, assumeTrue) {
|
|
72406
72399
|
var name = getPropertyNameFromType(nameType);
|
|
72407
72400
|
var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, /*assumeTrue*/ true); });
|
|
72408
72401
|
if (isKnownProperty) {
|
|
@@ -72483,7 +72476,7 @@ var ts;
|
|
|
72483
72476
|
return getTypeWithFacts(type, assumeTrue ? 524288 /* TypeFacts.NEUndefined */ : 65536 /* TypeFacts.EQUndefined */);
|
|
72484
72477
|
}
|
|
72485
72478
|
if (isMatchingReference(reference, target)) {
|
|
72486
|
-
return
|
|
72479
|
+
return narrowTypeByInKeyword(type, leftType, assumeTrue);
|
|
72487
72480
|
}
|
|
72488
72481
|
}
|
|
72489
72482
|
break;
|
|
@@ -72672,7 +72665,7 @@ var ts;
|
|
|
72672
72665
|
neverType;
|
|
72673
72666
|
});
|
|
72674
72667
|
}
|
|
72675
|
-
function
|
|
72668
|
+
function narrowTypeBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
|
|
72676
72669
|
var witnesses = getSwitchClauseTypeOfWitnesses(switchStatement);
|
|
72677
72670
|
if (!witnesses) {
|
|
72678
72671
|
return type;
|
|
@@ -83039,7 +83032,7 @@ var ts;
|
|
|
83039
83032
|
// We only need `Awaited<T>` if `T` is a type variable that has no base constraint, or the base constraint of `T` is `any`, `unknown`, `{}`, `object`,
|
|
83040
83033
|
// or is promise-like.
|
|
83041
83034
|
if (baseConstraint ?
|
|
83042
|
-
baseConstraint.flags & 3 /* TypeFlags.AnyOrUnknown */ || isEmptyObjectType(baseConstraint) ||
|
|
83035
|
+
baseConstraint.flags & 3 /* TypeFlags.AnyOrUnknown */ || isEmptyObjectType(baseConstraint) || someType(baseConstraint, isThenableType) :
|
|
83043
83036
|
maybeTypeOfKind(type, 8650752 /* TypeFlags.TypeVariable */)) {
|
|
83044
83037
|
return true;
|
|
83045
83038
|
}
|
|
@@ -86854,12 +86847,11 @@ var ts;
|
|
|
86854
86847
|
}
|
|
86855
86848
|
}
|
|
86856
86849
|
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
|
|
86857
|
-
var _a;
|
|
86858
86850
|
switch (node.kind) {
|
|
86859
86851
|
case 240 /* SyntaxKind.VariableStatement */:
|
|
86860
86852
|
// error each individual name in variable statement instead of marking the entire variable statement
|
|
86861
|
-
for (var _i = 0,
|
|
86862
|
-
var decl =
|
|
86853
|
+
for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
|
|
86854
|
+
var decl = _a[_i];
|
|
86863
86855
|
checkModuleAugmentationElement(decl, isGlobalAugmentation);
|
|
86864
86856
|
}
|
|
86865
86857
|
break;
|
|
@@ -86875,8 +86867,8 @@ var ts;
|
|
|
86875
86867
|
case 257 /* SyntaxKind.VariableDeclaration */:
|
|
86876
86868
|
var name = node.name;
|
|
86877
86869
|
if (ts.isBindingPattern(name)) {
|
|
86878
|
-
for (var
|
|
86879
|
-
var el =
|
|
86870
|
+
for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {
|
|
86871
|
+
var el = _c[_b];
|
|
86880
86872
|
// mark individual names in binding pattern
|
|
86881
86873
|
checkModuleAugmentationElement(el, isGlobalAugmentation);
|
|
86882
86874
|
}
|
|
@@ -86892,18 +86884,6 @@ var ts;
|
|
|
86892
86884
|
if (isGlobalAugmentation) {
|
|
86893
86885
|
return;
|
|
86894
86886
|
}
|
|
86895
|
-
var symbol = getSymbolOfNode(node);
|
|
86896
|
-
if (symbol) {
|
|
86897
|
-
// module augmentations cannot introduce new names on the top level scope of the module
|
|
86898
|
-
// this is done it two steps
|
|
86899
|
-
// 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error
|
|
86900
|
-
// 2. main check - report error if value declaration of the parent symbol is module augmentation)
|
|
86901
|
-
var reportError = !(symbol.flags & 33554432 /* SymbolFlags.Transient */);
|
|
86902
|
-
if (!reportError) {
|
|
86903
|
-
// symbol should not originate in augmentation
|
|
86904
|
-
reportError = !!((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.declarations) && ts.isExternalModuleAugmentation(symbol.parent.declarations[0]);
|
|
86905
|
-
}
|
|
86906
|
-
}
|
|
86907
86887
|
break;
|
|
86908
86888
|
}
|
|
86909
86889
|
}
|
|
@@ -107398,7 +107378,7 @@ var ts;
|
|
|
107398
107378
|
return createImportCallExpressionUMD(argument !== null && argument !== void 0 ? argument : factory.createVoidZero(), containsLexicalThis);
|
|
107399
107379
|
case ts.ModuleKind.CommonJS:
|
|
107400
107380
|
default:
|
|
107401
|
-
return createImportCallExpressionCommonJS(argument
|
|
107381
|
+
return createImportCallExpressionCommonJS(argument);
|
|
107402
107382
|
}
|
|
107403
107383
|
}
|
|
107404
107384
|
function createImportCallExpressionUMD(arg, containsLexicalThis) {
|
|
@@ -107421,7 +107401,7 @@ var ts;
|
|
|
107421
107401
|
return factory.createConditionalExpression(
|
|
107422
107402
|
/*condition*/ factory.createIdentifier("__syncRequire"),
|
|
107423
107403
|
/*questionToken*/ undefined,
|
|
107424
|
-
/*whenTrue*/ createImportCallExpressionCommonJS(arg
|
|
107404
|
+
/*whenTrue*/ createImportCallExpressionCommonJS(arg),
|
|
107425
107405
|
/*colonToken*/ undefined,
|
|
107426
107406
|
/*whenFalse*/ createImportCallExpressionAMD(argClone, containsLexicalThis));
|
|
107427
107407
|
}
|
|
@@ -107430,7 +107410,7 @@ var ts;
|
|
|
107430
107410
|
return factory.createComma(factory.createAssignment(temp, arg), factory.createConditionalExpression(
|
|
107431
107411
|
/*condition*/ factory.createIdentifier("__syncRequire"),
|
|
107432
107412
|
/*questionToken*/ undefined,
|
|
107433
|
-
/*whenTrue*/ createImportCallExpressionCommonJS(temp,
|
|
107413
|
+
/*whenTrue*/ createImportCallExpressionCommonJS(temp, /* isInlineable */ true),
|
|
107434
107414
|
/*colonToken*/ undefined,
|
|
107435
107415
|
/*whenFalse*/ createImportCallExpressionAMD(temp, containsLexicalThis)));
|
|
107436
107416
|
}
|
|
@@ -107480,14 +107460,20 @@ var ts;
|
|
|
107480
107460
|
}
|
|
107481
107461
|
return promise;
|
|
107482
107462
|
}
|
|
107483
|
-
function createImportCallExpressionCommonJS(arg,
|
|
107484
|
-
// import(
|
|
107463
|
+
function createImportCallExpressionCommonJS(arg, isInlineable) {
|
|
107464
|
+
// import(x)
|
|
107485
107465
|
// emit as
|
|
107486
|
-
//
|
|
107466
|
+
// var _a;
|
|
107467
|
+
// (_a = x, Promise.resolve().then(() => require(_a)) /*CommonJs Require*/
|
|
107487
107468
|
// We have to wrap require in then callback so that require is done in asynchronously
|
|
107488
107469
|
// if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately
|
|
107489
|
-
|
|
107490
|
-
var
|
|
107470
|
+
// If the arg is not inlineable, we have to evaluate it in the current scope with a temp var
|
|
107471
|
+
var temp = arg && !ts.isSimpleInlineableExpression(arg) && !isInlineable ? factory.createTempVariable(hoistVariableDeclaration) : undefined;
|
|
107472
|
+
var promiseResolveCall = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Promise"), "resolve"),
|
|
107473
|
+
/*typeArguments*/ undefined,
|
|
107474
|
+
/*argumentsArray*/ []);
|
|
107475
|
+
var requireCall = factory.createCallExpression(factory.createIdentifier("require"),
|
|
107476
|
+
/*typeArguments*/ undefined, temp ? [temp] : arg ? [arg] : []);
|
|
107491
107477
|
if (ts.getESModuleInterop(compilerOptions)) {
|
|
107492
107478
|
requireCall = emitHelpers().createImportStarHelper(requireCall);
|
|
107493
107479
|
}
|
|
@@ -107508,14 +107494,9 @@ var ts;
|
|
|
107508
107494
|
/*typeParameters*/ undefined,
|
|
107509
107495
|
/*parameters*/ [],
|
|
107510
107496
|
/*type*/ undefined, factory.createBlock([factory.createReturnStatement(requireCall)]));
|
|
107511
|
-
// if there is a lexical 'this' in the import call arguments, ensure we indicate
|
|
107512
|
-
// that this new function expression indicates it captures 'this' so that the
|
|
107513
|
-
// es2015 transformer will properly substitute 'this' with '_this'.
|
|
107514
|
-
if (containsLexicalThis) {
|
|
107515
|
-
ts.setEmitFlags(func, 8 /* EmitFlags.CapturesThis */);
|
|
107516
|
-
}
|
|
107517
107497
|
}
|
|
107518
|
-
|
|
107498
|
+
var downleveledImport = factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, "then"), /*typeArguments*/ undefined, [func]);
|
|
107499
|
+
return temp === undefined ? downleveledImport : factory.createCommaListExpression([factory.createAssignment(temp, arg), downleveledImport]);
|
|
107519
107500
|
}
|
|
107520
107501
|
function getHelperExpressionForExport(node, innerExpr) {
|
|
107521
107502
|
if (!ts.getESModuleInterop(compilerOptions) || ts.getEmitFlags(node) & 67108864 /* EmitFlags.NeverApplyImportHelper */) {
|
|
@@ -135890,7 +135871,7 @@ var ts;
|
|
|
135890
135871
|
if (preferences.includeCompletionsWithClassMemberSnippets &&
|
|
135891
135872
|
preferences.includeCompletionsWithInsertText &&
|
|
135892
135873
|
completionKind === 3 /* CompletionKind.MemberLike */ &&
|
|
135893
|
-
isClassLikeMemberCompletion(symbol, location)) {
|
|
135874
|
+
isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
135894
135875
|
var importAdder = void 0;
|
|
135895
135876
|
(_b = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, contextToken, formatContext), insertText = _b.insertText, isSnippet = _b.isSnippet, importAdder = _b.importAdder, replacementSpan = _b.replacementSpan);
|
|
135896
135877
|
sortText = Completions.SortText.ClassMemberSnippets; // sortText has to be lower priority than the sortText for keywords. See #47852.
|
|
@@ -135962,7 +135943,7 @@ var ts;
|
|
|
135962
135943
|
data: data,
|
|
135963
135944
|
};
|
|
135964
135945
|
}
|
|
135965
|
-
function isClassLikeMemberCompletion(symbol, location) {
|
|
135946
|
+
function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
135966
135947
|
// TODO: support JS files.
|
|
135967
135948
|
if (ts.isInJSFile(location)) {
|
|
135968
135949
|
return false;
|
|
@@ -135996,6 +135977,7 @@ var ts;
|
|
|
135996
135977
|
location.parent.parent &&
|
|
135997
135978
|
ts.isClassElement(location.parent) &&
|
|
135998
135979
|
location === location.parent.name &&
|
|
135980
|
+
location.parent.getLastToken(sourceFile) === location.parent.name &&
|
|
135999
135981
|
ts.isClassLike(location.parent.parent)) ||
|
|
136000
135982
|
(location.parent &&
|
|
136001
135983
|
ts.isSyntaxList(location) &&
|
|
@@ -144008,19 +143990,24 @@ var ts;
|
|
|
144008
143990
|
return getCommentOwnerInfoWorker(commentOwner.initializer, options);
|
|
144009
143991
|
case 260 /* SyntaxKind.ClassDeclaration */:
|
|
144010
143992
|
case 261 /* SyntaxKind.InterfaceDeclaration */:
|
|
144011
|
-
case 168 /* SyntaxKind.PropertySignature */:
|
|
144012
143993
|
case 263 /* SyntaxKind.EnumDeclaration */:
|
|
144013
143994
|
case 302 /* SyntaxKind.EnumMember */:
|
|
144014
143995
|
case 262 /* SyntaxKind.TypeAliasDeclaration */:
|
|
144015
143996
|
return { commentOwner: commentOwner };
|
|
143997
|
+
case 168 /* SyntaxKind.PropertySignature */: {
|
|
143998
|
+
var host_1 = commentOwner;
|
|
143999
|
+
return host_1.type && ts.isFunctionTypeNode(host_1.type)
|
|
144000
|
+
? { commentOwner: commentOwner, parameters: host_1.type.parameters, hasReturn: hasReturn(host_1.type, options) }
|
|
144001
|
+
: { commentOwner: commentOwner };
|
|
144002
|
+
}
|
|
144016
144003
|
case 240 /* SyntaxKind.VariableStatement */: {
|
|
144017
144004
|
var varStatement = commentOwner;
|
|
144018
144005
|
var varDeclarations = varStatement.declarationList.declarations;
|
|
144019
|
-
var
|
|
144006
|
+
var host_2 = varDeclarations.length === 1 && varDeclarations[0].initializer
|
|
144020
144007
|
? getRightHandSideOfAssignment(varDeclarations[0].initializer)
|
|
144021
144008
|
: undefined;
|
|
144022
|
-
return
|
|
144023
|
-
? { commentOwner: commentOwner, parameters:
|
|
144009
|
+
return host_2
|
|
144010
|
+
? { commentOwner: commentOwner, parameters: host_2.parameters, hasReturn: hasReturn(host_2, options) }
|
|
144024
144011
|
: { commentOwner: commentOwner };
|
|
144025
144012
|
}
|
|
144026
144013
|
case 308 /* SyntaxKind.SourceFile */:
|
|
@@ -144050,7 +144037,7 @@ var ts;
|
|
|
144050
144037
|
}
|
|
144051
144038
|
function hasReturn(node, options) {
|
|
144052
144039
|
return !!(options === null || options === void 0 ? void 0 : options.generateReturnInDocTemplate) &&
|
|
144053
|
-
(ts.isArrowFunction(node) && ts.isExpression(node.body)
|
|
144040
|
+
(ts.isFunctionTypeNode(node) || ts.isArrowFunction(node) && ts.isExpression(node.body)
|
|
144054
144041
|
|| ts.isFunctionLikeDeclaration(node) && node.body && ts.isBlock(node.body) && !!ts.forEachReturnStatement(node.body, function (n) { return n; }));
|
|
144055
144042
|
}
|
|
144056
144043
|
function getRightHandSideOfAssignment(rightHandSide) {
|
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 = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221019");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -21700,13 +21700,11 @@ var ts;
|
|
|
21700
21700
|
* Creates a `BaseNodeFactory` which can be used to create `Node` instances from the constructors provided by the object allocator.
|
|
21701
21701
|
*/
|
|
21702
21702
|
function createBaseNodeFactory() {
|
|
21703
|
-
// tslint:disable variable-name
|
|
21704
21703
|
var NodeConstructor;
|
|
21705
21704
|
var TokenConstructor;
|
|
21706
21705
|
var IdentifierConstructor;
|
|
21707
21706
|
var PrivateIdentifierConstructor;
|
|
21708
21707
|
var SourceFileConstructor;
|
|
21709
|
-
// tslint:enable variable-name
|
|
21710
21708
|
return {
|
|
21711
21709
|
createBaseSourceFileNode: createBaseSourceFileNode,
|
|
21712
21710
|
createBaseIdentifierNode: createBaseIdentifierNode,
|
|
@@ -27638,11 +27636,9 @@ var ts;
|
|
|
27638
27636
|
rawTextScanner.setText("`" + rawText + "`");
|
|
27639
27637
|
break;
|
|
27640
27638
|
case 15 /* SyntaxKind.TemplateHead */:
|
|
27641
|
-
// tslint:disable-next-line no-invalid-template-strings
|
|
27642
27639
|
rawTextScanner.setText("`" + rawText + "${");
|
|
27643
27640
|
break;
|
|
27644
27641
|
case 16 /* SyntaxKind.TemplateMiddle */:
|
|
27645
|
-
// tslint:disable-next-line no-invalid-template-strings
|
|
27646
27642
|
rawTextScanner.setText("}" + rawText + "${");
|
|
27647
27643
|
break;
|
|
27648
27644
|
case 17 /* SyntaxKind.TemplateTail */:
|
|
@@ -28001,7 +27997,6 @@ var ts;
|
|
|
28001
27997
|
return node;
|
|
28002
27998
|
}
|
|
28003
27999
|
ts.createInputFiles = createInputFiles;
|
|
28004
|
-
// tslint:disable-next-line variable-name
|
|
28005
28000
|
var SourceMapSource;
|
|
28006
28001
|
/**
|
|
28007
28002
|
* Create an external source map source file reference
|
|
@@ -32135,13 +32130,11 @@ var ts;
|
|
|
32135
32130
|
var scanner = ts.createScanner(99 /* ScriptTarget.Latest */, /*skipTrivia*/ true);
|
|
32136
32131
|
var disallowInAndDecoratorContext = 4096 /* NodeFlags.DisallowInContext */ | 16384 /* NodeFlags.DecoratorContext */;
|
|
32137
32132
|
// capture constructors in 'initializeState' to avoid null checks
|
|
32138
|
-
// tslint:disable variable-name
|
|
32139
32133
|
var NodeConstructor;
|
|
32140
32134
|
var TokenConstructor;
|
|
32141
32135
|
var IdentifierConstructor;
|
|
32142
32136
|
var PrivateIdentifierConstructor;
|
|
32143
32137
|
var SourceFileConstructor;
|
|
32144
|
-
// tslint:enable variable-name
|
|
32145
32138
|
function countNode(node) {
|
|
32146
32139
|
nodeCount++;
|
|
32147
32140
|
return node;
|
|
@@ -72111,7 +72104,7 @@ var ts;
|
|
|
72111
72104
|
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
|
|
72112
72105
|
}
|
|
72113
72106
|
else if (expr.kind === 218 /* SyntaxKind.TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
|
|
72114
|
-
type =
|
|
72107
|
+
type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
|
|
72115
72108
|
}
|
|
72116
72109
|
else {
|
|
72117
72110
|
if (strictNullChecks) {
|
|
@@ -72392,7 +72385,7 @@ var ts;
|
|
|
72392
72385
|
!!(prop.flags & 16777216 /* SymbolFlags.Optional */) || assumeTrue :
|
|
72393
72386
|
!!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
|
|
72394
72387
|
}
|
|
72395
|
-
function
|
|
72388
|
+
function narrowTypeByInKeyword(type, nameType, assumeTrue) {
|
|
72396
72389
|
var name = getPropertyNameFromType(nameType);
|
|
72397
72390
|
var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, /*assumeTrue*/ true); });
|
|
72398
72391
|
if (isKnownProperty) {
|
|
@@ -72473,7 +72466,7 @@ var ts;
|
|
|
72473
72466
|
return getTypeWithFacts(type, assumeTrue ? 524288 /* TypeFacts.NEUndefined */ : 65536 /* TypeFacts.EQUndefined */);
|
|
72474
72467
|
}
|
|
72475
72468
|
if (isMatchingReference(reference, target)) {
|
|
72476
|
-
return
|
|
72469
|
+
return narrowTypeByInKeyword(type, leftType, assumeTrue);
|
|
72477
72470
|
}
|
|
72478
72471
|
}
|
|
72479
72472
|
break;
|
|
@@ -72662,7 +72655,7 @@ var ts;
|
|
|
72662
72655
|
neverType;
|
|
72663
72656
|
});
|
|
72664
72657
|
}
|
|
72665
|
-
function
|
|
72658
|
+
function narrowTypeBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
|
|
72666
72659
|
var witnesses = getSwitchClauseTypeOfWitnesses(switchStatement);
|
|
72667
72660
|
if (!witnesses) {
|
|
72668
72661
|
return type;
|
|
@@ -83029,7 +83022,7 @@ var ts;
|
|
|
83029
83022
|
// We only need `Awaited<T>` if `T` is a type variable that has no base constraint, or the base constraint of `T` is `any`, `unknown`, `{}`, `object`,
|
|
83030
83023
|
// or is promise-like.
|
|
83031
83024
|
if (baseConstraint ?
|
|
83032
|
-
baseConstraint.flags & 3 /* TypeFlags.AnyOrUnknown */ || isEmptyObjectType(baseConstraint) ||
|
|
83025
|
+
baseConstraint.flags & 3 /* TypeFlags.AnyOrUnknown */ || isEmptyObjectType(baseConstraint) || someType(baseConstraint, isThenableType) :
|
|
83033
83026
|
maybeTypeOfKind(type, 8650752 /* TypeFlags.TypeVariable */)) {
|
|
83034
83027
|
return true;
|
|
83035
83028
|
}
|
|
@@ -86844,12 +86837,11 @@ var ts;
|
|
|
86844
86837
|
}
|
|
86845
86838
|
}
|
|
86846
86839
|
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
|
|
86847
|
-
var _a;
|
|
86848
86840
|
switch (node.kind) {
|
|
86849
86841
|
case 240 /* SyntaxKind.VariableStatement */:
|
|
86850
86842
|
// error each individual name in variable statement instead of marking the entire variable statement
|
|
86851
|
-
for (var _i = 0,
|
|
86852
|
-
var decl =
|
|
86843
|
+
for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
|
|
86844
|
+
var decl = _a[_i];
|
|
86853
86845
|
checkModuleAugmentationElement(decl, isGlobalAugmentation);
|
|
86854
86846
|
}
|
|
86855
86847
|
break;
|
|
@@ -86865,8 +86857,8 @@ var ts;
|
|
|
86865
86857
|
case 257 /* SyntaxKind.VariableDeclaration */:
|
|
86866
86858
|
var name = node.name;
|
|
86867
86859
|
if (ts.isBindingPattern(name)) {
|
|
86868
|
-
for (var
|
|
86869
|
-
var el =
|
|
86860
|
+
for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {
|
|
86861
|
+
var el = _c[_b];
|
|
86870
86862
|
// mark individual names in binding pattern
|
|
86871
86863
|
checkModuleAugmentationElement(el, isGlobalAugmentation);
|
|
86872
86864
|
}
|
|
@@ -86882,18 +86874,6 @@ var ts;
|
|
|
86882
86874
|
if (isGlobalAugmentation) {
|
|
86883
86875
|
return;
|
|
86884
86876
|
}
|
|
86885
|
-
var symbol = getSymbolOfNode(node);
|
|
86886
|
-
if (symbol) {
|
|
86887
|
-
// module augmentations cannot introduce new names on the top level scope of the module
|
|
86888
|
-
// this is done it two steps
|
|
86889
|
-
// 1. quick check - if symbol for node is not merged - this is local symbol to this augmentation - report error
|
|
86890
|
-
// 2. main check - report error if value declaration of the parent symbol is module augmentation)
|
|
86891
|
-
var reportError = !(symbol.flags & 33554432 /* SymbolFlags.Transient */);
|
|
86892
|
-
if (!reportError) {
|
|
86893
|
-
// symbol should not originate in augmentation
|
|
86894
|
-
reportError = !!((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.declarations) && ts.isExternalModuleAugmentation(symbol.parent.declarations[0]);
|
|
86895
|
-
}
|
|
86896
|
-
}
|
|
86897
86877
|
break;
|
|
86898
86878
|
}
|
|
86899
86879
|
}
|
|
@@ -107388,7 +107368,7 @@ var ts;
|
|
|
107388
107368
|
return createImportCallExpressionUMD(argument !== null && argument !== void 0 ? argument : factory.createVoidZero(), containsLexicalThis);
|
|
107389
107369
|
case ts.ModuleKind.CommonJS:
|
|
107390
107370
|
default:
|
|
107391
|
-
return createImportCallExpressionCommonJS(argument
|
|
107371
|
+
return createImportCallExpressionCommonJS(argument);
|
|
107392
107372
|
}
|
|
107393
107373
|
}
|
|
107394
107374
|
function createImportCallExpressionUMD(arg, containsLexicalThis) {
|
|
@@ -107411,7 +107391,7 @@ var ts;
|
|
|
107411
107391
|
return factory.createConditionalExpression(
|
|
107412
107392
|
/*condition*/ factory.createIdentifier("__syncRequire"),
|
|
107413
107393
|
/*questionToken*/ undefined,
|
|
107414
|
-
/*whenTrue*/ createImportCallExpressionCommonJS(arg
|
|
107394
|
+
/*whenTrue*/ createImportCallExpressionCommonJS(arg),
|
|
107415
107395
|
/*colonToken*/ undefined,
|
|
107416
107396
|
/*whenFalse*/ createImportCallExpressionAMD(argClone, containsLexicalThis));
|
|
107417
107397
|
}
|
|
@@ -107420,7 +107400,7 @@ var ts;
|
|
|
107420
107400
|
return factory.createComma(factory.createAssignment(temp, arg), factory.createConditionalExpression(
|
|
107421
107401
|
/*condition*/ factory.createIdentifier("__syncRequire"),
|
|
107422
107402
|
/*questionToken*/ undefined,
|
|
107423
|
-
/*whenTrue*/ createImportCallExpressionCommonJS(temp,
|
|
107403
|
+
/*whenTrue*/ createImportCallExpressionCommonJS(temp, /* isInlineable */ true),
|
|
107424
107404
|
/*colonToken*/ undefined,
|
|
107425
107405
|
/*whenFalse*/ createImportCallExpressionAMD(temp, containsLexicalThis)));
|
|
107426
107406
|
}
|
|
@@ -107470,14 +107450,20 @@ var ts;
|
|
|
107470
107450
|
}
|
|
107471
107451
|
return promise;
|
|
107472
107452
|
}
|
|
107473
|
-
function createImportCallExpressionCommonJS(arg,
|
|
107474
|
-
// import(
|
|
107453
|
+
function createImportCallExpressionCommonJS(arg, isInlineable) {
|
|
107454
|
+
// import(x)
|
|
107475
107455
|
// emit as
|
|
107476
|
-
//
|
|
107456
|
+
// var _a;
|
|
107457
|
+
// (_a = x, Promise.resolve().then(() => require(_a)) /*CommonJs Require*/
|
|
107477
107458
|
// We have to wrap require in then callback so that require is done in asynchronously
|
|
107478
107459
|
// if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately
|
|
107479
|
-
|
|
107480
|
-
var
|
|
107460
|
+
// If the arg is not inlineable, we have to evaluate it in the current scope with a temp var
|
|
107461
|
+
var temp = arg && !ts.isSimpleInlineableExpression(arg) && !isInlineable ? factory.createTempVariable(hoistVariableDeclaration) : undefined;
|
|
107462
|
+
var promiseResolveCall = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Promise"), "resolve"),
|
|
107463
|
+
/*typeArguments*/ undefined,
|
|
107464
|
+
/*argumentsArray*/ []);
|
|
107465
|
+
var requireCall = factory.createCallExpression(factory.createIdentifier("require"),
|
|
107466
|
+
/*typeArguments*/ undefined, temp ? [temp] : arg ? [arg] : []);
|
|
107481
107467
|
if (ts.getESModuleInterop(compilerOptions)) {
|
|
107482
107468
|
requireCall = emitHelpers().createImportStarHelper(requireCall);
|
|
107483
107469
|
}
|
|
@@ -107498,14 +107484,9 @@ var ts;
|
|
|
107498
107484
|
/*typeParameters*/ undefined,
|
|
107499
107485
|
/*parameters*/ [],
|
|
107500
107486
|
/*type*/ undefined, factory.createBlock([factory.createReturnStatement(requireCall)]));
|
|
107501
|
-
// if there is a lexical 'this' in the import call arguments, ensure we indicate
|
|
107502
|
-
// that this new function expression indicates it captures 'this' so that the
|
|
107503
|
-
// es2015 transformer will properly substitute 'this' with '_this'.
|
|
107504
|
-
if (containsLexicalThis) {
|
|
107505
|
-
ts.setEmitFlags(func, 8 /* EmitFlags.CapturesThis */);
|
|
107506
|
-
}
|
|
107507
107487
|
}
|
|
107508
|
-
|
|
107488
|
+
var downleveledImport = factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, "then"), /*typeArguments*/ undefined, [func]);
|
|
107489
|
+
return temp === undefined ? downleveledImport : factory.createCommaListExpression([factory.createAssignment(temp, arg), downleveledImport]);
|
|
107509
107490
|
}
|
|
107510
107491
|
function getHelperExpressionForExport(node, innerExpr) {
|
|
107511
107492
|
if (!ts.getESModuleInterop(compilerOptions) || ts.getEmitFlags(node) & 67108864 /* EmitFlags.NeverApplyImportHelper */) {
|
|
@@ -660,6 +660,8 @@
|
|
|
660
660
|
"Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219": "对修饰器的实验支持功能在将来的版本中可能更改。在 \"tsconfig\" 或 \"jsconfig\" 中设置 \"experimentalDecorators\" 选项以删除此警告。",
|
|
661
661
|
"Explicitly_specified_module_resolution_kind_Colon_0_6087": "显示指定了模块解析类型:“{0}”。",
|
|
662
662
|
"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791": "除非 \"target\" 选项设置为 \"es2016\" 或更高版本,否则不能对 \"bigint\" 值执行求幂运算。",
|
|
663
|
+
"Export_0_from_module_1_90059": "从模块“{1}”导出“{0}”",
|
|
664
|
+
"Export_all_referenced_locals_90060": "导出所有引用的局部变量",
|
|
663
665
|
"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203": "面向 ECMAScript 模块时,不能使用导出分配。请考虑改用 \"export default\" 或另一种模块格式。",
|
|
664
666
|
"Export_assignment_is_not_supported_when_module_flag_is_system_1218": "当 \"--module\" 标志是 \"system\" 时不支持导出分配。",
|
|
665
667
|
"Export_declaration_conflicts_with_exported_declaration_of_0_2484": "导出声明与“{0}”的导出声明冲突。",
|
|
@@ -908,6 +910,7 @@
|
|
|
908
910
|
"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650": "使 keyof 仅返回字符串,而不是字符串、数字或符号。旧版选项。",
|
|
909
911
|
"Make_super_call_the_first_statement_in_the_constructor_90002": "在构造函数中,使 \"super()\" 调用第一个语句",
|
|
910
912
|
"Mapped_object_type_implicitly_has_an_any_template_type_7039": "映射的对象类型隐式地含有 \"any\" 模板类型。",
|
|
913
|
+
"Matched_0_condition_1_6403": "匹配的“{0}”条件“{1}”。",
|
|
911
914
|
"Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457": "默认情况下匹配包括模式 “**/*”",
|
|
912
915
|
"Matched_by_include_pattern_0_in_1_1407": "通过在 \"{1}\" 中的包含模式 \"{0}\" 匹配",
|
|
913
916
|
"Member_0_implicitly_has_an_1_type_7008": "成员“{0}”隐式包含类型“{1}”。",
|
|
@@ -1220,6 +1223,7 @@
|
|
|
1220
1223
|
"Resolution_for_module_0_was_found_in_cache_from_location_1_6147": "在位置“{1}”的缓存中找到模块“{0}”的解析。",
|
|
1221
1224
|
"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241": "在位置“{1}”的缓存中找到类型引用指令“{0}”的解析。",
|
|
1222
1225
|
"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195": "只将 \"keyof\" 解析为字符串值的属性名称(不含数字或符号)。",
|
|
1226
|
+
"Resolving_in_0_mode_with_conditions_1_6402": "正在 {0} 模式下解析,条件为 {1}。",
|
|
1223
1227
|
"Resolving_module_0_from_1_6086": "======== 正在从“{1}”解析模块“{0}”。========",
|
|
1224
1228
|
"Resolving_module_name_0_relative_to_base_url_1_2_6094": "正在相对于基 URL“{1}”-“{2}”解析模块名“{0}”。",
|
|
1225
1229
|
"Resolving_real_path_for_0_result_1_6130": "正在解析“{0}”的真实路径,结果为“{1}”。",
|
|
@@ -1276,6 +1280,7 @@
|
|
|
1276
1280
|
"Root_file_specified_for_compilation_1427": "为编译指定的根文件",
|
|
1277
1281
|
"STRATEGY_6039": "策略",
|
|
1278
1282
|
"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642": "保存 .tsbuildinfo 文件以允许项目增量编译。",
|
|
1283
|
+
"Saw_non_matching_condition_0_6405": "看到了不匹配的条件“{0}”。",
|
|
1279
1284
|
"Scoped_package_detected_looking_in_0_6182": "检测到范围包,请在“{0}”中查看",
|
|
1280
1285
|
"Selection_is_not_a_valid_statement_or_statements_95155": "所选内容不是有效的语句",
|
|
1281
1286
|
"Selection_is_not_a_valid_type_node_95133": "所选内容不是有效的类型节点",
|
|
@@ -1654,6 +1659,7 @@
|
|
|
1654
1659
|
"Use_element_access_for_0_95145": "对“{0}”使用元素访问",
|
|
1655
1660
|
"Use_element_access_for_all_undeclared_properties_95146": "对所有未声明的属性使用元素访问。",
|
|
1656
1661
|
"Use_synthetic_default_member_95016": "使用综合的“默认”成员。",
|
|
1662
|
+
"Using_0_subpath_1_with_target_2_6404": "将“{0}”子路径“{1}”与目标“{2}”一起使用",
|
|
1657
1663
|
"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "仅 ECMAScript 5 和更高版本支持在 \"for...of\" 语句中使用字符串。",
|
|
1658
1664
|
"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915": "使用 --build,-b 将使 tsc 的行为更像生成业务流程协调程序,而非编译器。这可用于触发生成复合项目,你可以在 {0} 详细了解这些项目",
|
|
1659
1665
|
"Using_compiler_options_of_project_reference_redirect_0_6215": "使用项目引用重定向“{0}”的编译器选项。",
|
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.9.0-dev.
|
|
5
|
+
"version": "4.9.0-dev.20221019",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|