typescript 4.5.0-dev.20211014 → 4.5.0-dev.20211018
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 +71 -76
- package/lib/tsserver.js +110 -116
- package/lib/tsserverlibrary.js +109 -115
- package/lib/typescript.js +109 -115
- package/lib/typescriptServices.js +109 -115
- package/lib/typingsInstaller.js +80 -91
- 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.20211018";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -118,21 +118,24 @@ var ts;
|
|
|
118
118
|
return typeof Set !== "undefined" && "entries" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;
|
|
119
119
|
}
|
|
120
120
|
NativeCollections.tryGetNativeSet = tryGetNativeSet;
|
|
121
|
-
})(NativeCollections
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
(
|
|
121
|
+
})(NativeCollections || (NativeCollections = {}));
|
|
122
|
+
/* @internal */
|
|
123
|
+
ts.Map = getCollectionImplementation("Map", "tryGetNativeMap", "createMapShim");
|
|
124
|
+
/* @internal */
|
|
125
|
+
ts.Set = getCollectionImplementation("Set", "tryGetNativeSet", "createSetShim");
|
|
126
|
+
/* @internal */
|
|
126
127
|
function getCollectionImplementation(name, nativeFactory, shimFactory) {
|
|
127
128
|
var _a;
|
|
128
129
|
// NOTE: ts.ShimCollections will be defined for typescriptServices.js but not for tsc.js, so we must test for it.
|
|
129
|
-
var constructor = (_a =
|
|
130
|
+
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
|
|
130
131
|
if (constructor)
|
|
131
132
|
return constructor;
|
|
132
133
|
throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
|
|
133
134
|
}
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
})(ts || (ts = {}));
|
|
136
|
+
/* @internal */
|
|
137
|
+
var ts;
|
|
138
|
+
(function (ts) {
|
|
136
139
|
function getIterator(iterable) {
|
|
137
140
|
if (iterable) {
|
|
138
141
|
if (isArray(iterable))
|
|
@@ -7812,6 +7815,11 @@ var ts;
|
|
|
7812
7815
|
}
|
|
7813
7816
|
return sys;
|
|
7814
7817
|
})();
|
|
7818
|
+
/*@internal*/
|
|
7819
|
+
function setSys(s) {
|
|
7820
|
+
ts.sys = s;
|
|
7821
|
+
}
|
|
7822
|
+
ts.setSys = setSys;
|
|
7815
7823
|
if (ts.sys && ts.sys.getEnvironmentVariable) {
|
|
7816
7824
|
setCustomPollingValues(ts.sys);
|
|
7817
7825
|
ts.Debug.setAssertionLevel(/^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))
|
|
@@ -9377,7 +9385,7 @@ var ts;
|
|
|
9377
9385
|
Circularity_detected_while_resolving_configuration_Colon_0: diag(18000, ts.DiagnosticCategory.Error, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"),
|
|
9378
9386
|
The_files_list_in_config_file_0_is_empty: diag(18002, ts.DiagnosticCategory.Error, "The_files_list_in_config_file_0_is_empty_18002", "The 'files' list in config file '{0}' is empty."),
|
|
9379
9387
|
No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: diag(18003, ts.DiagnosticCategory.Error, "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),
|
|
9380
|
-
|
|
9388
|
+
File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module: diag(80001, ts.DiagnosticCategory.Suggestion, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001", "File is a CommonJS module; it may be converted to an ES module."),
|
|
9381
9389
|
This_constructor_function_may_be_converted_to_a_class_declaration: diag(80002, ts.DiagnosticCategory.Suggestion, "This_constructor_function_may_be_converted_to_a_class_declaration_80002", "This constructor function may be converted to a class declaration."),
|
|
9382
9390
|
Import_may_be_converted_to_a_default_import: diag(80003, ts.DiagnosticCategory.Suggestion, "Import_may_be_converted_to_a_default_import_80003", "Import may be converted to a default import."),
|
|
9383
9391
|
JSDoc_types_may_be_moved_to_TypeScript_types: diag(80004, ts.DiagnosticCategory.Suggestion, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."),
|
|
@@ -9439,7 +9447,7 @@ var ts;
|
|
|
9439
9447
|
Install_0: diag(95014, ts.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"),
|
|
9440
9448
|
Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."),
|
|
9441
9449
|
Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."),
|
|
9442
|
-
|
|
9450
|
+
Convert_to_ES_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES_module_95017", "Convert to ES module"),
|
|
9443
9451
|
Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"),
|
|
9444
9452
|
Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"),
|
|
9445
9453
|
Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"),
|
|
@@ -35954,16 +35962,21 @@ var ts;
|
|
|
35954
35962
|
var pos = getNodePos();
|
|
35955
35963
|
parseExpected(129 /* AssertKeyword */);
|
|
35956
35964
|
var openBracePosition = scanner.getTokenPos();
|
|
35957
|
-
parseExpected(18 /* OpenBraceToken */)
|
|
35958
|
-
|
|
35959
|
-
|
|
35960
|
-
|
|
35961
|
-
|
|
35962
|
-
|
|
35963
|
-
|
|
35965
|
+
if (parseExpected(18 /* OpenBraceToken */)) {
|
|
35966
|
+
var multiLine = scanner.hasPrecedingLineBreak();
|
|
35967
|
+
var elements = parseDelimitedList(24 /* AssertEntries */, parseAssertEntry, /*considerSemicolonAsDelimiter*/ true);
|
|
35968
|
+
if (!parseExpected(19 /* CloseBraceToken */)) {
|
|
35969
|
+
var lastError = ts.lastOrUndefined(parseDiagnostics);
|
|
35970
|
+
if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {
|
|
35971
|
+
ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
|
|
35972
|
+
}
|
|
35964
35973
|
}
|
|
35974
|
+
return finishNode(factory.createAssertClause(elements, multiLine), pos);
|
|
35975
|
+
}
|
|
35976
|
+
else {
|
|
35977
|
+
var elements = createNodeArray([], getNodePos(), /*end*/ undefined, /*hasTrailingComma*/ false);
|
|
35978
|
+
return finishNode(factory.createAssertClause(elements, /*multiLine*/ false), pos);
|
|
35965
35979
|
}
|
|
35966
|
-
return finishNode(factory.createAssertClause(elements, multiLine), pos);
|
|
35967
35980
|
}
|
|
35968
35981
|
function tokenAfterImportDefinitelyProducesImportDeclaration() {
|
|
35969
35982
|
return token() === 41 /* AsteriskToken */ || token() === 18 /* OpenBraceToken */;
|
|
@@ -36858,8 +36871,9 @@ var ts;
|
|
|
36858
36871
|
return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start);
|
|
36859
36872
|
}
|
|
36860
36873
|
function parseSeeTag(start, tagName, indent, indentText) {
|
|
36861
|
-
var
|
|
36862
|
-
|
|
36874
|
+
var isMarkdownOrJSDocLink = token() === 22 /* OpenBracketToken */
|
|
36875
|
+
|| lookAhead(function () { return nextTokenJSDoc() === 59 /* AtToken */ && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue() === "link"; });
|
|
36876
|
+
var nameExpression = isMarkdownOrJSDocLink ? undefined : parseJSDocNameReference();
|
|
36863
36877
|
var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, getNodePos(), indent, indentText) : undefined;
|
|
36864
36878
|
return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start);
|
|
36865
36879
|
}
|
|
@@ -57803,7 +57817,7 @@ var ts;
|
|
|
57803
57817
|
return false;
|
|
57804
57818
|
switch (node.kind) {
|
|
57805
57819
|
case 79 /* Identifier */:
|
|
57806
|
-
return node.escapedText === argumentsSymbol.escapedName &&
|
|
57820
|
+
return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol;
|
|
57807
57821
|
case 166 /* PropertyDeclaration */:
|
|
57808
57822
|
case 168 /* MethodDeclaration */:
|
|
57809
57823
|
case 171 /* GetAccessor */:
|
|
@@ -67327,7 +67341,7 @@ var ts;
|
|
|
67327
67341
|
var keyPropertyName = getKeyPropertyName(unionType);
|
|
67328
67342
|
var propNode = keyPropertyName && ts.find(node.properties, function (p) { return p.symbol && p.kind === 294 /* PropertyAssignment */ &&
|
|
67329
67343
|
p.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p.initializer); });
|
|
67330
|
-
var propType = propNode &&
|
|
67344
|
+
var propType = propNode && getContextFreeTypeOfExpression(propNode.initializer);
|
|
67331
67345
|
return propType && getConstituentTypeForKeyType(unionType, propType);
|
|
67332
67346
|
}
|
|
67333
67347
|
function isOrContainsMatchingReference(source, target) {
|
|
@@ -70562,7 +70576,7 @@ var ts;
|
|
|
70562
70576
|
return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 294 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return getContextFreeTypeOfExpression(prop.initializer); }, prop.symbol.escapedName]; }), ts.map(ts.filter(getPropertiesOfType(contextualType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return [function () { return undefinedType; }, s.escapedName]; })), isTypeAssignableTo, contextualType);
|
|
70563
70577
|
}
|
|
70564
70578
|
function discriminateContextualTypeByJSXAttributes(node, contextualType) {
|
|
70565
|
-
return discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 284 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return
|
|
70579
|
+
return discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 284 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return getContextFreeTypeOfExpression(prop.initializer); }), prop.symbol.escapedName]; }), ts.map(ts.filter(getPropertiesOfType(contextualType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return [function () { return undefinedType; }, s.escapedName]; })), isTypeAssignableTo, contextualType);
|
|
70566
70580
|
}
|
|
70567
70581
|
// Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily
|
|
70568
70582
|
// be "pushed" onto a node using the contextualType property.
|
|
@@ -94828,51 +94842,25 @@ var ts;
|
|
|
94828
94842
|
return tagTransform(node.openingFragment, node.children, isChild, /*location*/ node);
|
|
94829
94843
|
}
|
|
94830
94844
|
function convertJsxChildrenToChildrenPropObject(children) {
|
|
94845
|
+
var prop = convertJsxChildrenToChildrenPropAssignment(children);
|
|
94846
|
+
return prop && factory.createObjectLiteralExpression([prop]);
|
|
94847
|
+
}
|
|
94848
|
+
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
94831
94849
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
94832
94850
|
if (ts.length(nonWhitespaceChildren) === 1) {
|
|
94833
94851
|
var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
94834
|
-
return result_13 && factory.
|
|
94835
|
-
factory.createPropertyAssignment("children", result_13)
|
|
94836
|
-
]);
|
|
94852
|
+
return result_13 && factory.createPropertyAssignment("children", result_13);
|
|
94837
94853
|
}
|
|
94838
94854
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
94839
|
-
return
|
|
94840
|
-
factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result))
|
|
94841
|
-
]);
|
|
94855
|
+
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
94842
94856
|
}
|
|
94843
94857
|
function visitJsxOpeningLikeElementJSX(node, children, isChild, location) {
|
|
94844
94858
|
var tagName = getTagName(node);
|
|
94845
|
-
var
|
|
94859
|
+
var childrenProp = children && children.length ? convertJsxChildrenToChildrenPropAssignment(children) : undefined;
|
|
94846
94860
|
var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === "key"; });
|
|
94847
94861
|
var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties;
|
|
94848
|
-
var
|
|
94849
|
-
|
|
94850
|
-
// Map spans of JsxAttribute nodes into object literals and spans
|
|
94851
|
-
// of JsxSpreadAttribute nodes into expressions.
|
|
94852
|
-
segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread
|
|
94853
|
-
? ts.map(attrs, transformJsxSpreadAttributeToExpression)
|
|
94854
|
-
: factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); }));
|
|
94855
|
-
if (ts.isJsxSpreadAttribute(attrs[0])) {
|
|
94856
|
-
// We must always emit at least one object literal before a spread
|
|
94857
|
-
// argument.factory.createObjectLiteral
|
|
94858
|
-
segments.unshift(factory.createObjectLiteralExpression());
|
|
94859
|
-
}
|
|
94860
|
-
}
|
|
94861
|
-
if (children && children.length) {
|
|
94862
|
-
var result = convertJsxChildrenToChildrenPropObject(children);
|
|
94863
|
-
if (result) {
|
|
94864
|
-
segments.push(result);
|
|
94865
|
-
}
|
|
94866
|
-
}
|
|
94867
|
-
if (segments.length === 0) {
|
|
94868
|
-
objectProperties = factory.createObjectLiteralExpression([]);
|
|
94869
|
-
// When there are no attributes, React wants {}
|
|
94870
|
-
}
|
|
94871
|
-
else {
|
|
94872
|
-
// Either emit one big object literal (no spread attribs), or
|
|
94873
|
-
// a call to the __assign helper.
|
|
94874
|
-
objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments);
|
|
94875
|
-
}
|
|
94862
|
+
var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) :
|
|
94863
|
+
factory.createObjectLiteralExpression(childrenProp ? [childrenProp] : ts.emptyArray); // When there are no attributes, React wants {}
|
|
94876
94864
|
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location);
|
|
94877
94865
|
}
|
|
94878
94866
|
function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) {
|
|
@@ -94901,38 +94889,9 @@ var ts;
|
|
|
94901
94889
|
}
|
|
94902
94890
|
function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) {
|
|
94903
94891
|
var tagName = getTagName(node);
|
|
94904
|
-
var objectProperties;
|
|
94905
94892
|
var attrs = node.attributes.properties;
|
|
94906
|
-
|
|
94907
|
-
|
|
94908
|
-
// When there are no attributes, React wants "null"
|
|
94909
|
-
}
|
|
94910
|
-
else {
|
|
94911
|
-
var target = ts.getEmitScriptTarget(compilerOptions);
|
|
94912
|
-
if (target && target >= 5 /* ES2018 */) {
|
|
94913
|
-
objectProperties = factory.createObjectLiteralExpression(ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) {
|
|
94914
|
-
return isSpread ? ts.map(attrs, transformJsxSpreadAttributeToSpreadAssignment) : ts.map(attrs, transformJsxAttributeToObjectLiteralElement);
|
|
94915
|
-
})));
|
|
94916
|
-
}
|
|
94917
|
-
else {
|
|
94918
|
-
// Map spans of JsxAttribute nodes into object literals and spans
|
|
94919
|
-
// of JsxSpreadAttribute nodes into expressions.
|
|
94920
|
-
var segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread
|
|
94921
|
-
? ts.map(attrs, transformJsxSpreadAttributeToExpression)
|
|
94922
|
-
: factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); }));
|
|
94923
|
-
if (ts.isJsxSpreadAttribute(attrs[0])) {
|
|
94924
|
-
// We must always emit at least one object literal before a spread
|
|
94925
|
-
// argument.factory.createObjectLiteral
|
|
94926
|
-
segments.unshift(factory.createObjectLiteralExpression());
|
|
94927
|
-
}
|
|
94928
|
-
// Either emit one big object literal (no spread attribs), or
|
|
94929
|
-
// a call to the __assign helper.
|
|
94930
|
-
objectProperties = ts.singleOrUndefined(segments);
|
|
94931
|
-
if (!objectProperties) {
|
|
94932
|
-
objectProperties = emitHelpers().createAssignHelper(segments);
|
|
94933
|
-
}
|
|
94934
|
-
}
|
|
94935
|
-
}
|
|
94893
|
+
var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs) :
|
|
94894
|
+
factory.createNull(); // When there are no attributes, React wants "null"
|
|
94936
94895
|
var callee = currentFileState.importSpecifier === undefined
|
|
94937
94896
|
? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217
|
|
94938
94897
|
node)
|
|
@@ -94965,6 +94924,36 @@ var ts;
|
|
|
94965
94924
|
function transformJsxSpreadAttributeToSpreadAssignment(node) {
|
|
94966
94925
|
return factory.createSpreadAssignment(ts.visitNode(node.expression, visitor, ts.isExpression));
|
|
94967
94926
|
}
|
|
94927
|
+
function transformJsxAttributesToObjectProps(attrs, children) {
|
|
94928
|
+
var target = ts.getEmitScriptTarget(compilerOptions);
|
|
94929
|
+
return target && target >= 5 /* ES2018 */ ? factory.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) :
|
|
94930
|
+
transformJsxAttributesToExpression(attrs, children);
|
|
94931
|
+
}
|
|
94932
|
+
function transformJsxAttributesToProps(attrs, children) {
|
|
94933
|
+
var props = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) {
|
|
94934
|
+
return ts.map(attrs, function (attr) { return isSpread ? transformJsxSpreadAttributeToSpreadAssignment(attr) : transformJsxAttributeToObjectLiteralElement(attr); });
|
|
94935
|
+
}));
|
|
94936
|
+
if (children) {
|
|
94937
|
+
props.push(children);
|
|
94938
|
+
}
|
|
94939
|
+
return props;
|
|
94940
|
+
}
|
|
94941
|
+
function transformJsxAttributesToExpression(attrs, children) {
|
|
94942
|
+
// Map spans of JsxAttribute nodes into object literals and spans
|
|
94943
|
+
// of JsxSpreadAttribute nodes into expressions.
|
|
94944
|
+
var expressions = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread
|
|
94945
|
+
? ts.map(attrs, transformJsxSpreadAttributeToExpression)
|
|
94946
|
+
: factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); }));
|
|
94947
|
+
if (ts.isJsxSpreadAttribute(attrs[0])) {
|
|
94948
|
+
// We must always emit at least one object literal before a spread
|
|
94949
|
+
// argument.factory.createObjectLiteral
|
|
94950
|
+
expressions.unshift(factory.createObjectLiteralExpression());
|
|
94951
|
+
}
|
|
94952
|
+
if (children) {
|
|
94953
|
+
expressions.push(factory.createObjectLiteralExpression([children]));
|
|
94954
|
+
}
|
|
94955
|
+
return ts.singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
|
|
94956
|
+
}
|
|
94968
94957
|
function transformJsxSpreadAttributeToExpression(node) {
|
|
94969
94958
|
return ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
94970
94959
|
}
|
|
@@ -113098,7 +113087,7 @@ var ts;
|
|
|
113098
113087
|
break;
|
|
113099
113088
|
case ts.FileIncludeKind.TypeReferenceDirective:
|
|
113100
113089
|
(_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end);
|
|
113101
|
-
packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName),
|
|
113090
|
+
packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), file.impliedNodeFormat)) === null || _g === void 0 ? void 0 : _g.packageId;
|
|
113102
113091
|
break;
|
|
113103
113092
|
case ts.FileIncludeKind.LibReferenceDirective:
|
|
113104
113093
|
(_c = file.libReferenceDirectives[index], pos = _c.pos, end = _c.end);
|
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.5.0-dev.
|
|
5
|
+
"version": "4.5.0-dev.20211018",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|