typescript 4.9.0-dev.20221020 → 4.9.0-dev.20221022
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 +93 -21
- package/lib/tsserver.js +114 -37
- package/lib/tsserverlibrary.js +114 -37
- package/lib/typescript.js +114 -37
- package/lib/typescriptServices.js +114 -37
- package/lib/typingsInstaller.js +113 -36
- 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 = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221022");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -1881,8 +1881,8 @@ var ts;
|
|
|
1881
1881
|
return compareValues(a === null || a === void 0 ? void 0 : a.start, b === null || b === void 0 ? void 0 : b.start) || compareValues(a === null || a === void 0 ? void 0 : a.length, b === null || b === void 0 ? void 0 : b.length);
|
|
1882
1882
|
}
|
|
1883
1883
|
ts.compareTextSpans = compareTextSpans;
|
|
1884
|
-
function min(
|
|
1885
|
-
return compare(
|
|
1884
|
+
function min(items, compare) {
|
|
1885
|
+
return reduceLeft(items, function (x, y) { return compare(x, y) === -1 /* Comparison.LessThan */ ? x : y; });
|
|
1886
1886
|
}
|
|
1887
1887
|
ts.min = min;
|
|
1888
1888
|
/**
|
|
@@ -5099,8 +5099,8 @@ var ts;
|
|
|
5099
5099
|
NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance";
|
|
5100
5100
|
NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic";
|
|
5101
5101
|
NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked";
|
|
5102
|
-
NodeCheckFlags[NodeCheckFlags["
|
|
5103
|
-
NodeCheckFlags[NodeCheckFlags["
|
|
5102
|
+
NodeCheckFlags[NodeCheckFlags["MethodWithSuperPropertyAccessInAsync"] = 2048] = "MethodWithSuperPropertyAccessInAsync";
|
|
5103
|
+
NodeCheckFlags[NodeCheckFlags["MethodWithSuperPropertyAssignmentInAsync"] = 4096] = "MethodWithSuperPropertyAssignmentInAsync";
|
|
5104
5104
|
NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments";
|
|
5105
5105
|
NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed";
|
|
5106
5106
|
NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass";
|
|
@@ -42251,12 +42251,23 @@ var ts;
|
|
|
42251
42251
|
}
|
|
42252
42252
|
function writeConfigurations() {
|
|
42253
42253
|
// Filter applicable options to place in the file
|
|
42254
|
-
var categorizedOptions = ts.
|
|
42254
|
+
var categorizedOptions = new ts.Map();
|
|
42255
|
+
// Set allowed categories in order
|
|
42256
|
+
categorizedOptions.set(ts.Diagnostics.Projects, []);
|
|
42257
|
+
categorizedOptions.set(ts.Diagnostics.Language_and_Environment, []);
|
|
42258
|
+
categorizedOptions.set(ts.Diagnostics.Modules, []);
|
|
42259
|
+
categorizedOptions.set(ts.Diagnostics.JavaScript_Support, []);
|
|
42260
|
+
categorizedOptions.set(ts.Diagnostics.Emit, []);
|
|
42261
|
+
categorizedOptions.set(ts.Diagnostics.Interop_Constraints, []);
|
|
42262
|
+
categorizedOptions.set(ts.Diagnostics.Type_Checking, []);
|
|
42263
|
+
categorizedOptions.set(ts.Diagnostics.Completeness, []);
|
|
42255
42264
|
for (var _i = 0, optionDeclarations_1 = ts.optionDeclarations; _i < optionDeclarations_1.length; _i++) {
|
|
42256
42265
|
var option = optionDeclarations_1[_i];
|
|
42257
|
-
var category = option.category;
|
|
42258
42266
|
if (isAllowedOptionForOutput(option)) {
|
|
42259
|
-
categorizedOptions.
|
|
42267
|
+
var listForCategory = categorizedOptions.get(option.category);
|
|
42268
|
+
if (!listForCategory)
|
|
42269
|
+
categorizedOptions.set(option.category, listForCategory = []);
|
|
42270
|
+
listForCategory.push(option);
|
|
42260
42271
|
}
|
|
42261
42272
|
}
|
|
42262
42273
|
// Serialize all options and their descriptions
|
|
@@ -42267,7 +42278,7 @@ var ts;
|
|
|
42267
42278
|
if (entries.length !== 0) {
|
|
42268
42279
|
entries.push({ value: "" });
|
|
42269
42280
|
}
|
|
42270
|
-
entries.push({ value: "/* ".concat(category, " */") });
|
|
42281
|
+
entries.push({ value: "/* ".concat(ts.getLocaleSpecificMessage(category), " */") });
|
|
42271
42282
|
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
42272
42283
|
var option = options_1[_i];
|
|
42273
42284
|
var optionName = void 0;
|
|
@@ -73278,7 +73289,7 @@ var ts;
|
|
|
73278
73289
|
// We only look for uninitialized variables in strict null checking mode, and only when we can analyze
|
|
73279
73290
|
// the entire control flow graph from the variable's declaration (i.e. when the flow container and
|
|
73280
73291
|
// declaration container are the same).
|
|
73281
|
-
var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports ||
|
|
73292
|
+
var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) ||
|
|
73282
73293
|
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* TypeFlags.AnyOrUnknown */ | 16384 /* TypeFlags.Void */)) !== 0 ||
|
|
73283
73294
|
isInTypeQuery(node) || node.parent.kind === 278 /* SyntaxKind.ExportSpecifier */) ||
|
|
73284
73295
|
node.parent.kind === 232 /* SyntaxKind.NonNullExpression */ ||
|
|
@@ -73307,6 +73318,12 @@ var ts;
|
|
|
73307
73318
|
}
|
|
73308
73319
|
return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType;
|
|
73309
73320
|
}
|
|
73321
|
+
function isSameScopedBindingElement(node, declaration) {
|
|
73322
|
+
if (ts.isBindingElement(declaration)) {
|
|
73323
|
+
var bindingElement = ts.findAncestor(node, ts.isBindingElement);
|
|
73324
|
+
return bindingElement && ts.getRootDeclaration(bindingElement) === ts.getRootDeclaration(declaration);
|
|
73325
|
+
}
|
|
73326
|
+
}
|
|
73310
73327
|
function shouldMarkIdentifierAliasReferenced(node) {
|
|
73311
73328
|
var _a;
|
|
73312
73329
|
var parent = node.parent;
|
|
@@ -73648,12 +73665,17 @@ var ts;
|
|
|
73648
73665
|
var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true);
|
|
73649
73666
|
var container = immediateContainer;
|
|
73650
73667
|
var needToCaptureLexicalThis = false;
|
|
73668
|
+
var inAsyncFunction = false;
|
|
73651
73669
|
// adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting
|
|
73652
73670
|
if (!isCallExpression) {
|
|
73653
73671
|
while (container && container.kind === 216 /* SyntaxKind.ArrowFunction */) {
|
|
73672
|
+
if (ts.hasSyntacticModifier(container, 512 /* ModifierFlags.Async */))
|
|
73673
|
+
inAsyncFunction = true;
|
|
73654
73674
|
container = ts.getSuperContainer(container, /*stopOnFunctions*/ true);
|
|
73655
73675
|
needToCaptureLexicalThis = languageVersion < 2 /* ScriptTarget.ES2015 */;
|
|
73656
73676
|
}
|
|
73677
|
+
if (container && ts.hasSyntacticModifier(container, 512 /* ModifierFlags.Async */))
|
|
73678
|
+
inAsyncFunction = true;
|
|
73657
73679
|
}
|
|
73658
73680
|
var canUseSuperExpression = isLegalUsageOfSuperExpression(container);
|
|
73659
73681
|
var nodeCheckFlag = 0;
|
|
@@ -73759,12 +73781,12 @@ var ts;
|
|
|
73759
73781
|
// as a call expression cannot be used as the target of a destructuring assignment while a property access can.
|
|
73760
73782
|
//
|
|
73761
73783
|
// For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations.
|
|
73762
|
-
if (container.kind === 171 /* SyntaxKind.MethodDeclaration */ &&
|
|
73784
|
+
if (container.kind === 171 /* SyntaxKind.MethodDeclaration */ && inAsyncFunction) {
|
|
73763
73785
|
if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
|
|
73764
|
-
getNodeLinks(container).flags |= 4096 /* NodeCheckFlags.
|
|
73786
|
+
getNodeLinks(container).flags |= 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */;
|
|
73765
73787
|
}
|
|
73766
73788
|
else {
|
|
73767
|
-
getNodeLinks(container).flags |= 2048 /* NodeCheckFlags.
|
|
73789
|
+
getNodeLinks(container).flags |= 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */;
|
|
73768
73790
|
}
|
|
73769
73791
|
}
|
|
73770
73792
|
if (needToCaptureLexicalThis) {
|
|
@@ -82920,7 +82942,7 @@ var ts;
|
|
|
82920
82942
|
return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0];
|
|
82921
82943
|
}
|
|
82922
82944
|
// primitives with a `{ then() }` won't be unwrapped/adopted.
|
|
82923
|
-
if (allTypesAssignableToKind(type, 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
|
|
82945
|
+
if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
|
|
82924
82946
|
return undefined;
|
|
82925
82947
|
}
|
|
82926
82948
|
var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217
|
|
@@ -82987,7 +83009,7 @@ var ts;
|
|
|
82987
83009
|
* Determines whether a type is an object with a callable `then` member.
|
|
82988
83010
|
*/
|
|
82989
83011
|
function isThenableType(type) {
|
|
82990
|
-
if (allTypesAssignableToKind(type, 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
|
|
83012
|
+
if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
|
|
82991
83013
|
// primitive types cannot be considered "thenable" since they are not objects.
|
|
82992
83014
|
return false;
|
|
82993
83015
|
}
|
|
@@ -98486,8 +98508,11 @@ var ts;
|
|
|
98486
98508
|
}
|
|
98487
98509
|
return ts.visitEachChild(node, visitor, context);
|
|
98488
98510
|
case 174 /* SyntaxKind.GetAccessor */:
|
|
98511
|
+
return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitGetAccessorDeclaration, node);
|
|
98489
98512
|
case 175 /* SyntaxKind.SetAccessor */:
|
|
98513
|
+
return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitSetAccessorDeclaration, node);
|
|
98490
98514
|
case 173 /* SyntaxKind.Constructor */:
|
|
98515
|
+
return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitConstructorDeclaration, node);
|
|
98491
98516
|
case 260 /* SyntaxKind.ClassDeclaration */:
|
|
98492
98517
|
case 228 /* SyntaxKind.ClassExpression */:
|
|
98493
98518
|
return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitDefault, node);
|
|
@@ -98588,6 +98613,9 @@ var ts;
|
|
|
98588
98613
|
return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(
|
|
98589
98614
|
/*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node);
|
|
98590
98615
|
}
|
|
98616
|
+
function visitConstructorDeclaration(node) {
|
|
98617
|
+
return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
|
|
98618
|
+
}
|
|
98591
98619
|
/**
|
|
98592
98620
|
* Visits a MethodDeclaration node.
|
|
98593
98621
|
*
|
|
@@ -98602,7 +98630,14 @@ var ts;
|
|
|
98602
98630
|
/*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
|
|
98603
98631
|
/*type*/ undefined, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
|
|
98604
98632
|
? transformAsyncFunctionBody(node)
|
|
98605
|
-
:
|
|
98633
|
+
: transformMethodBody(node));
|
|
98634
|
+
}
|
|
98635
|
+
function visitGetAccessorDeclaration(node) {
|
|
98636
|
+
return factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context),
|
|
98637
|
+
/*type*/ undefined, transformMethodBody(node));
|
|
98638
|
+
}
|
|
98639
|
+
function visitSetAccessorDeclaration(node) {
|
|
98640
|
+
return factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
|
|
98606
98641
|
}
|
|
98607
98642
|
/**
|
|
98608
98643
|
* Visits a FunctionDeclaration node.
|
|
@@ -98716,6 +98751,42 @@ var ts;
|
|
|
98716
98751
|
}
|
|
98717
98752
|
return false;
|
|
98718
98753
|
}
|
|
98754
|
+
function transformMethodBody(node) {
|
|
98755
|
+
ts.Debug.assertIsDefined(node.body);
|
|
98756
|
+
var savedCapturedSuperProperties = capturedSuperProperties;
|
|
98757
|
+
var savedHasSuperElementAccess = hasSuperElementAccess;
|
|
98758
|
+
capturedSuperProperties = new ts.Set();
|
|
98759
|
+
hasSuperElementAccess = false;
|
|
98760
|
+
var updated = ts.visitFunctionBody(node.body, visitor, context);
|
|
98761
|
+
// Minor optimization, emit `_super` helper to capture `super` access in an arrow.
|
|
98762
|
+
// This step isn't needed if we eventually transform this to ES5.
|
|
98763
|
+
var originalMethod = ts.getOriginalNode(node, ts.isFunctionLikeDeclaration);
|
|
98764
|
+
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ &&
|
|
98765
|
+
resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) &&
|
|
98766
|
+
(ts.getFunctionFlags(originalMethod) & 3 /* FunctionFlags.AsyncGenerator */) !== 3 /* FunctionFlags.AsyncGenerator */;
|
|
98767
|
+
if (emitSuperHelpers) {
|
|
98768
|
+
enableSubstitutionForAsyncMethodsWithSuper();
|
|
98769
|
+
if (capturedSuperProperties.size) {
|
|
98770
|
+
var variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
|
|
98771
|
+
substitutedSuperAccessors[ts.getNodeId(variableStatement)] = true;
|
|
98772
|
+
var statements = updated.statements.slice();
|
|
98773
|
+
ts.insertStatementsAfterStandardPrologue(statements, [variableStatement]);
|
|
98774
|
+
updated = factory.updateBlock(updated, statements);
|
|
98775
|
+
}
|
|
98776
|
+
if (hasSuperElementAccess) {
|
|
98777
|
+
// Emit helpers for super element access expressions (`super[x]`).
|
|
98778
|
+
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
98779
|
+
ts.addEmitHelper(updated, ts.advancedAsyncSuperHelper);
|
|
98780
|
+
}
|
|
98781
|
+
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
|
|
98782
|
+
ts.addEmitHelper(updated, ts.asyncSuperHelper);
|
|
98783
|
+
}
|
|
98784
|
+
}
|
|
98785
|
+
}
|
|
98786
|
+
capturedSuperProperties = savedCapturedSuperProperties;
|
|
98787
|
+
hasSuperElementAccess = savedHasSuperElementAccess;
|
|
98788
|
+
return updated;
|
|
98789
|
+
}
|
|
98719
98790
|
function transformAsyncFunctionBody(node) {
|
|
98720
98791
|
resumeLexicalEnvironment();
|
|
98721
98792
|
var original = ts.getOriginalNode(node, ts.isFunctionLike);
|
|
@@ -98748,7 +98819,7 @@ var ts;
|
|
|
98748
98819
|
ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
98749
98820
|
// Minor optimization, emit `_super` helper to capture `super` access in an arrow.
|
|
98750
98821
|
// This step isn't needed if we eventually transform this to ES5.
|
|
98751
|
-
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.
|
|
98822
|
+
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */);
|
|
98752
98823
|
if (emitSuperHelpers) {
|
|
98753
98824
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
98754
98825
|
if (capturedSuperProperties.size) {
|
|
@@ -98761,10 +98832,10 @@ var ts;
|
|
|
98761
98832
|
ts.setTextRange(block, node.body);
|
|
98762
98833
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
98763
98834
|
// Emit helpers for super element access expressions (`super[x]`).
|
|
98764
|
-
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.
|
|
98835
|
+
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
98765
98836
|
ts.addEmitHelper(block, ts.advancedAsyncSuperHelper);
|
|
98766
98837
|
}
|
|
98767
|
-
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.
|
|
98838
|
+
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
|
|
98768
98839
|
ts.addEmitHelper(block, ts.asyncSuperHelper);
|
|
98769
98840
|
}
|
|
98770
98841
|
}
|
|
@@ -98836,7 +98907,7 @@ var ts;
|
|
|
98836
98907
|
// If we need to support substitutions for `super` in an async method,
|
|
98837
98908
|
// we should track it here.
|
|
98838
98909
|
if (enabledSubstitutions & 1 /* ES2017SubstitutionFlags.AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
98839
|
-
var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.
|
|
98910
|
+
var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */ | 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */);
|
|
98840
98911
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
98841
98912
|
var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
98842
98913
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -98913,7 +98984,7 @@ var ts;
|
|
|
98913
98984
|
|| kind === 175 /* SyntaxKind.SetAccessor */;
|
|
98914
98985
|
}
|
|
98915
98986
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
98916
|
-
if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.
|
|
98987
|
+
if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
98917
98988
|
return ts.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createUniqueName("_superIndex", 16 /* GeneratedIdentifierFlags.Optimistic */ | 32 /* GeneratedIdentifierFlags.FileLevel */),
|
|
98918
98989
|
/*typeArguments*/ undefined, [argumentExpression]), "value"), location);
|
|
98919
98990
|
}
|
|
@@ -98928,7 +98999,7 @@ var ts;
|
|
|
98928
98999
|
function createSuperAccessVariableStatement(factory, resolver, node, names) {
|
|
98929
99000
|
// Create a variable declaration with a getter/setter (if binding) definition for each name:
|
|
98930
99001
|
// const _super = Object.create(null, { x: { get: () => super.x, set: (v) => super.x = v }, ... });
|
|
98931
|
-
var hasBinding = (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.
|
|
99002
|
+
var hasBinding = (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) !== 0;
|
|
98932
99003
|
var accessors = [];
|
|
98933
99004
|
names.forEach(function (_, key) {
|
|
98934
99005
|
var name = ts.unescapeLeadingUnderscores(key);
|
|
@@ -99636,7 +99707,7 @@ var ts;
|
|
|
99636
99707
|
/*type*/ undefined, factory.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset))), !!(hierarchyFacts & 1 /* HierarchyFacts.HasLexicalThis */)));
|
|
99637
99708
|
// Minor optimization, emit `_super` helper to capture `super` access in an arrow.
|
|
99638
99709
|
// This step isn't needed if we eventually transform this to ES5.
|
|
99639
|
-
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.
|
|
99710
|
+
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */);
|
|
99640
99711
|
if (emitSuperHelpers) {
|
|
99641
99712
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
99642
99713
|
var variableStatement = ts.createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
|
|
@@ -99647,10 +99718,10 @@ var ts;
|
|
|
99647
99718
|
ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
99648
99719
|
var block = factory.updateBlock(node.body, statements);
|
|
99649
99720
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
99650
|
-
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.
|
|
99721
|
+
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
99651
99722
|
ts.addEmitHelper(block, ts.advancedAsyncSuperHelper);
|
|
99652
99723
|
}
|
|
99653
|
-
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.
|
|
99724
|
+
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
|
|
99654
99725
|
ts.addEmitHelper(block, ts.asyncSuperHelper);
|
|
99655
99726
|
}
|
|
99656
99727
|
}
|
|
@@ -99779,7 +99850,7 @@ var ts;
|
|
|
99779
99850
|
// If we need to support substitutions for `super` in an async method,
|
|
99780
99851
|
// we should track it here.
|
|
99781
99852
|
if (enabledSubstitutions & 1 /* ESNextSubstitutionFlags.AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
99782
|
-
var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.
|
|
99853
|
+
var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */ | 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */);
|
|
99783
99854
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
99784
99855
|
var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
99785
99856
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -99856,7 +99927,7 @@ var ts;
|
|
|
99856
99927
|
|| kind === 175 /* SyntaxKind.SetAccessor */;
|
|
99857
99928
|
}
|
|
99858
99929
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
99859
|
-
if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.
|
|
99930
|
+
if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
99860
99931
|
return ts.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createIdentifier("_superIndex"),
|
|
99861
99932
|
/*typeArguments*/ undefined, [argumentExpression]), "value"), location);
|
|
99862
99933
|
}
|
|
@@ -123882,7 +123953,7 @@ var ts;
|
|
|
123882
123953
|
var isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47 /* CharacterCodes.slash */;
|
|
123883
123954
|
if (isNonDirectorySeparatorRoot &&
|
|
123884
123955
|
dirPath.search(/[a-zA-Z]:/) !== 0 && // Non dos style paths
|
|
123885
|
-
pathPartForUserCheck.search(/[a-zA-
|
|
123956
|
+
pathPartForUserCheck.search(/[a-zA-Z]\$\//) === 0) { // Dos style nextPart
|
|
123886
123957
|
nextDirectorySeparator = dirPath.indexOf(ts.directorySeparator, nextDirectorySeparator + 1);
|
|
123887
123958
|
if (nextDirectorySeparator === -1) {
|
|
123888
123959
|
// ignore "//vda1cs4850/c$/folderAtRoot"
|
|
@@ -125388,15 +125459,21 @@ var ts;
|
|
|
125388
125459
|
return undefined;
|
|
125389
125460
|
}
|
|
125390
125461
|
function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) {
|
|
125391
|
-
var
|
|
125392
|
-
if (
|
|
125462
|
+
var normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
|
|
125463
|
+
if (normalizedTargetPaths === undefined) {
|
|
125464
|
+
return undefined;
|
|
125465
|
+
}
|
|
125466
|
+
var normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
|
|
125467
|
+
var relativePaths = ts.flatMap(normalizedSourcePaths, function (sourcePath) {
|
|
125468
|
+
return ts.map(normalizedTargetPaths, function (targetPath) { return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName)); });
|
|
125469
|
+
});
|
|
125470
|
+
var shortest = ts.min(relativePaths, ts.compareNumberOfDirectorySeparators);
|
|
125471
|
+
if (!shortest) {
|
|
125393
125472
|
return undefined;
|
|
125394
125473
|
}
|
|
125395
|
-
var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
|
|
125396
|
-
var relativePath = normalizedSourcePath !== undefined ? ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(normalizedSourcePath, normalizedTargetPath, getCanonicalFileName)) : normalizedTargetPath;
|
|
125397
125474
|
return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs
|
|
125398
|
-
? removeExtensionAndIndexPostFix(
|
|
125399
|
-
: ts.removeFileExtension(
|
|
125475
|
+
? removeExtensionAndIndexPostFix(shortest, ending, compilerOptions)
|
|
125476
|
+
: ts.removeFileExtension(shortest);
|
|
125400
125477
|
}
|
|
125401
125478
|
function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
|
|
125402
125479
|
var path = _a.path, isRedirect = _a.isRedirect;
|
|
@@ -125533,8 +125610,8 @@ var ts;
|
|
|
125533
125610
|
}
|
|
125534
125611
|
}
|
|
125535
125612
|
}
|
|
125536
|
-
function
|
|
125537
|
-
return ts.
|
|
125613
|
+
function getPathsRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
|
|
125614
|
+
return ts.mapDefined(rootDirs, function (rootDir) {
|
|
125538
125615
|
var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
|
|
125539
125616
|
return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
|
|
125540
125617
|
});
|
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.20221022",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|