mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
Update deps
This commit is contained in:
parent
4f6fa314b0
commit
07cbd6dacb
5 changed files with 299 additions and 221 deletions
18
package-lock.json
generated
18
package-lock.json
generated
|
|
@ -11,15 +11,15 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-editor-core": {
|
"monaco-editor-core": {
|
||||||
"version": "0.18.0",
|
"version": "0.18.1",
|
||||||
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.18.0.tgz",
|
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.18.1.tgz",
|
||||||
"integrity": "sha512-URcHNAqH9X2JvO2skkIisAL4XAcZXxrDC8kcyr453sXQpOHUxicZpXHQb4/arXGvxrWvei3a6zZzpdT1gjeVJA==",
|
"integrity": "sha512-euzXzmwjZFG0oAPGjICMwINcZBzQDyfGDYlAR5YNMBJZO9Bmkqq1xpTTze/qQ0KKbVmawFXiwgUbg7WVgebP9Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-languages": {
|
"monaco-languages": {
|
||||||
"version": "1.7.0",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-1.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-1.8.0.tgz",
|
||||||
"integrity": "sha512-2YrYlkCF/g2H0PDt/ERax2IStaihZ17v1JkYnj2xEALYNah0pbQvGH9gXJvdVx0EpBoSRmxVnrwwM2oBWWOjSQ==",
|
"integrity": "sha512-vC/lqNgSslQT3vSlNOpyT34ELK0eoNbA/rHUvTUjQemIiR1GpRMKhuwB21BqzWk+0MjZuJydGSCQMCebBge7jg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-plugin-helpers": {
|
"monaco-plugin-helpers": {
|
||||||
|
|
@ -81,9 +81,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.7.2",
|
"version": "3.7.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz",
|
||||||
"integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==",
|
"integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@
|
||||||
"url": "https://github.com/Microsoft/monaco-typescript/issues"
|
"url": "https://github.com/Microsoft/monaco-typescript/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"monaco-editor-core": "^0.18.0",
|
"monaco-editor-core": "^0.18.1",
|
||||||
"monaco-languages": "^1.7.0",
|
"monaco-languages": "^1.8.0",
|
||||||
"monaco-plugin-helpers": "^1.0.2",
|
"monaco-plugin-helpers": "^1.0.2",
|
||||||
"requirejs": "^2.3.6",
|
"requirejs": "^2.3.6",
|
||||||
"terser": "^4.4.3",
|
"terser": "^4.4.3",
|
||||||
"typescript": "^3.7.2"
|
"typescript": "^3.7.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ var ts;
|
||||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||||
ts.versionMajorMinor = "3.7";
|
ts.versionMajorMinor = "3.7";
|
||||||
/** The version of the TypeScript compiler release */
|
/** The version of the TypeScript compiler release */
|
||||||
ts.version = ts.versionMajorMinor + ".2";
|
ts.version = ts.versionMajorMinor + ".3";
|
||||||
})(ts || (ts = {}));
|
})(ts || (ts = {}));
|
||||||
(function (ts) {
|
(function (ts) {
|
||||||
/* @internal */
|
/* @internal */
|
||||||
|
|
@ -3942,11 +3942,13 @@ var ts;
|
||||||
SignatureFlags[SignatureFlags["None"] = 0] = "None";
|
SignatureFlags[SignatureFlags["None"] = 0] = "None";
|
||||||
SignatureFlags[SignatureFlags["HasRestParameter"] = 1] = "HasRestParameter";
|
SignatureFlags[SignatureFlags["HasRestParameter"] = 1] = "HasRestParameter";
|
||||||
SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes";
|
SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes";
|
||||||
SignatureFlags[SignatureFlags["IsOptionalCall"] = 4] = "IsOptionalCall";
|
SignatureFlags[SignatureFlags["IsInnerCallChain"] = 4] = "IsInnerCallChain";
|
||||||
// We do not propagate `IsOptionalCall` to instantiated signatures, as that would result in us
|
SignatureFlags[SignatureFlags["IsOuterCallChain"] = 8] = "IsOuterCallChain";
|
||||||
|
// We do not propagate `IsInnerCallChain` to instantiated signatures, as that would result in us
|
||||||
// attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when
|
// attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when
|
||||||
// instantiating the return type.
|
// instantiating the return type.
|
||||||
SignatureFlags[SignatureFlags["PropagatingFlags"] = 3] = "PropagatingFlags";
|
SignatureFlags[SignatureFlags["PropagatingFlags"] = 3] = "PropagatingFlags";
|
||||||
|
SignatureFlags[SignatureFlags["CallChainFlags"] = 12] = "CallChainFlags";
|
||||||
})(SignatureFlags = ts.SignatureFlags || (ts.SignatureFlags = {}));
|
})(SignatureFlags = ts.SignatureFlags || (ts.SignatureFlags = {}));
|
||||||
var IndexKind;
|
var IndexKind;
|
||||||
(function (IndexKind) {
|
(function (IndexKind) {
|
||||||
|
|
@ -6486,7 +6488,7 @@ var ts;
|
||||||
Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),
|
Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),
|
||||||
Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."),
|
Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."),
|
||||||
Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."),
|
Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."),
|
||||||
Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' in can have at most one '*' character."),
|
Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."),
|
||||||
Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."),
|
Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."),
|
||||||
Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, ts.DiagnosticCategory.Error, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),
|
Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, ts.DiagnosticCategory.Error, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),
|
||||||
File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),
|
File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),
|
||||||
|
|
@ -12485,30 +12487,31 @@ var ts;
|
||||||
* @param host An EmitHost.
|
* @param host An EmitHost.
|
||||||
* @param targetSourceFile An optional target source file to emit.
|
* @param targetSourceFile An optional target source file to emit.
|
||||||
*/
|
*/
|
||||||
function getSourceFilesToEmit(host, targetSourceFile) {
|
function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {
|
||||||
var options = host.getCompilerOptions();
|
var options = host.getCompilerOptions();
|
||||||
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
|
|
||||||
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
|
|
||||||
if (options.outFile || options.out) {
|
if (options.outFile || options.out) {
|
||||||
var moduleKind = ts.getEmitModuleKind(options);
|
var moduleKind = ts.getEmitModuleKind(options);
|
||||||
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
|
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
|
||||||
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
|
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
|
||||||
return ts.filter(host.getSourceFiles(), function (sourceFile) {
|
return ts.filter(host.getSourceFiles(), function (sourceFile) {
|
||||||
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
|
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&
|
||||||
|
sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
|
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
|
||||||
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
|
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ts.getSourceFilesToEmit = getSourceFilesToEmit;
|
ts.getSourceFilesToEmit = getSourceFilesToEmit;
|
||||||
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
|
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
|
||||||
function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
|
function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
|
||||||
|
var options = host.getCompilerOptions();
|
||||||
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
|
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
|
||||||
!sourceFile.isDeclarationFile &&
|
!sourceFile.isDeclarationFile &&
|
||||||
!isSourceFileFromExternalLibrary(sourceFile) &&
|
!host.isSourceFileFromExternalLibrary(sourceFile) &&
|
||||||
!(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
|
!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
|
||||||
|
(forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
|
||||||
}
|
}
|
||||||
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
|
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
|
||||||
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
|
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
|
||||||
|
|
@ -14600,14 +14603,36 @@ var ts;
|
||||||
|| kind === 195 /* CallExpression */);
|
|| kind === 195 /* CallExpression */);
|
||||||
}
|
}
|
||||||
ts.isOptionalChain = isOptionalChain;
|
ts.isOptionalChain = isOptionalChain;
|
||||||
|
/* @internal */
|
||||||
|
function isOptionalChainRoot(node) {
|
||||||
|
return isOptionalChain(node) && !!node.questionDotToken;
|
||||||
|
}
|
||||||
|
ts.isOptionalChainRoot = isOptionalChainRoot;
|
||||||
/**
|
/**
|
||||||
* Determines whether a node is the expression preceding an optional chain (i.e. `a` in `a?.b`).
|
* Determines whether a node is the expression preceding an optional chain (i.e. `a` in `a?.b`).
|
||||||
*/
|
*/
|
||||||
/* @internal */
|
/* @internal */
|
||||||
function isExpressionOfOptionalChainRoot(node) {
|
function isExpressionOfOptionalChainRoot(node) {
|
||||||
return ts.isOptionalChainRoot(node.parent) && node.parent.expression === node;
|
return isOptionalChainRoot(node.parent) && node.parent.expression === node;
|
||||||
}
|
}
|
||||||
ts.isExpressionOfOptionalChainRoot = isExpressionOfOptionalChainRoot;
|
ts.isExpressionOfOptionalChainRoot = isExpressionOfOptionalChainRoot;
|
||||||
|
/**
|
||||||
|
* Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`:
|
||||||
|
*
|
||||||
|
* 1. For `a?.b.c`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.`)
|
||||||
|
* 2. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain)
|
||||||
|
* 3. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is
|
||||||
|
* the end of the chain starting at `c?.`)
|
||||||
|
* 4. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is
|
||||||
|
* the end of the chain starting at `a?.`)
|
||||||
|
*/
|
||||||
|
/* @internal */
|
||||||
|
function isOutermostOptionalChain(node) {
|
||||||
|
return !isOptionalChain(node.parent) // cases 1 and 2
|
||||||
|
|| isOptionalChainRoot(node.parent) // case 3
|
||||||
|
|| node !== node.parent.expression; // case 4
|
||||||
|
}
|
||||||
|
ts.isOutermostOptionalChain = isOutermostOptionalChain;
|
||||||
function isNullishCoalesce(node) {
|
function isNullishCoalesce(node) {
|
||||||
return node.kind === 208 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
|
return node.kind === 208 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
|
||||||
}
|
}
|
||||||
|
|
@ -15882,11 +15907,6 @@ var ts;
|
||||||
return node.kind === 162 /* GetAccessor */;
|
return node.kind === 162 /* GetAccessor */;
|
||||||
}
|
}
|
||||||
ts.isGetAccessor = isGetAccessor;
|
ts.isGetAccessor = isGetAccessor;
|
||||||
/* @internal */
|
|
||||||
function isOptionalChainRoot(node) {
|
|
||||||
return ts.isOptionalChain(node) && !!node.questionDotToken;
|
|
||||||
}
|
|
||||||
ts.isOptionalChainRoot = isOptionalChainRoot;
|
|
||||||
/** True if has jsdoc nodes attached to it. */
|
/** True if has jsdoc nodes attached to it. */
|
||||||
/* @internal */
|
/* @internal */
|
||||||
// TODO: GH#19856 Would like to return `node is Node & { jsDoc: JSDoc[] }` but it causes long compile times
|
// TODO: GH#19856 Would like to return `node is Node & { jsDoc: JSDoc[] }` but it causes long compile times
|
||||||
|
|
@ -16787,6 +16807,8 @@ var ts;
|
||||||
var patterns = [];
|
var patterns = [];
|
||||||
for (var _i = 0, patternStrings_1 = patternStrings; _i < patternStrings_1.length; _i++) {
|
for (var _i = 0, patternStrings_1 = patternStrings; _i < patternStrings_1.length; _i++) {
|
||||||
var patternString = patternStrings_1[_i];
|
var patternString = patternStrings_1[_i];
|
||||||
|
if (!ts.hasZeroOrOneAsteriskCharacter(patternString))
|
||||||
|
continue;
|
||||||
var pattern = tryParsePattern(patternString);
|
var pattern = tryParsePattern(patternString);
|
||||||
if (pattern) {
|
if (pattern) {
|
||||||
patterns.push(pattern);
|
patterns.push(pattern);
|
||||||
|
|
@ -29221,7 +29243,7 @@ var ts;
|
||||||
}
|
}
|
||||||
function bindCondition(node, trueTarget, falseTarget) {
|
function bindCondition(node, trueTarget, falseTarget) {
|
||||||
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
||||||
if (!node || !isLogicalExpression(node) && !(ts.isOptionalChain(node) && isOutermostOptionalChain(node))) {
|
if (!node || !isLogicalExpression(node) && !(ts.isOptionalChain(node) && ts.isOutermostOptionalChain(node))) {
|
||||||
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
||||||
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
||||||
}
|
}
|
||||||
|
|
@ -29693,12 +29715,9 @@ var ts;
|
||||||
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
|
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function isOutermostOptionalChain(node) {
|
|
||||||
return !ts.isOptionalChain(node.parent) || ts.isOptionalChainRoot(node.parent) || node !== node.parent.expression;
|
|
||||||
}
|
|
||||||
function bindOptionalExpression(node, trueTarget, falseTarget) {
|
function bindOptionalExpression(node, trueTarget, falseTarget) {
|
||||||
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
||||||
if (!ts.isOptionalChain(node) || isOutermostOptionalChain(node)) {
|
if (!ts.isOptionalChain(node) || ts.isOutermostOptionalChain(node)) {
|
||||||
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
||||||
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
||||||
}
|
}
|
||||||
|
|
@ -29736,7 +29755,7 @@ var ts;
|
||||||
currentFlow = finishFlowLabel(preChainLabel);
|
currentFlow = finishFlowLabel(preChainLabel);
|
||||||
}
|
}
|
||||||
doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget);
|
doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget);
|
||||||
if (isOutermostOptionalChain(node)) {
|
if (ts.isOutermostOptionalChain(node)) {
|
||||||
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
||||||
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
||||||
}
|
}
|
||||||
|
|
@ -30821,7 +30840,7 @@ var ts;
|
||||||
}
|
}
|
||||||
function bindObjectDefinePrototypeProperty(node) {
|
function bindObjectDefinePrototypeProperty(node) {
|
||||||
var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression);
|
var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression);
|
||||||
if (namespaceSymbol) {
|
if (namespaceSymbol && namespaceSymbol.valueDeclaration) {
|
||||||
// Ensure the namespace symbol becomes class-like
|
// Ensure the namespace symbol becomes class-like
|
||||||
addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */);
|
addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */);
|
||||||
}
|
}
|
||||||
|
|
@ -31548,7 +31567,8 @@ var ts;
|
||||||
|| ts.hasModifier(node, 2270 /* TypeScriptModifier */)
|
|| ts.hasModifier(node, 2270 /* TypeScriptModifier */)
|
||||||
|| node.typeParameters
|
|| node.typeParameters
|
||||||
|| node.type
|
|| node.type
|
||||||
|| !node.body) {
|
|| !node.body
|
||||||
|
|| node.questionToken) {
|
||||||
transformFlags |= 1 /* AssertTypeScript */;
|
transformFlags |= 1 /* AssertTypeScript */;
|
||||||
}
|
}
|
||||||
// function declarations with object rest destructuring are ES2018 syntax
|
// function declarations with object rest destructuring are ES2018 syntax
|
||||||
|
|
@ -31585,7 +31605,7 @@ var ts;
|
||||||
function computePropertyDeclaration(node, subtreeFlags) {
|
function computePropertyDeclaration(node, subtreeFlags) {
|
||||||
var transformFlags = subtreeFlags | 1048576 /* ContainsClassFields */;
|
var transformFlags = subtreeFlags | 1048576 /* ContainsClassFields */;
|
||||||
// Decorators, TypeScript-specific modifiers, and type annotations are TypeScript syntax.
|
// Decorators, TypeScript-specific modifiers, and type annotations are TypeScript syntax.
|
||||||
if (ts.some(node.decorators) || ts.hasModifier(node, 2270 /* TypeScriptModifier */) || node.type) {
|
if (ts.some(node.decorators) || ts.hasModifier(node, 2270 /* TypeScriptModifier */) || node.type || node.questionToken) {
|
||||||
transformFlags |= 1 /* AssertTypeScript */;
|
transformFlags |= 1 /* AssertTypeScript */;
|
||||||
}
|
}
|
||||||
// Hoisted variables related to class properties should live within the TypeScript class wrapper.
|
// Hoisted variables related to class properties should live within the TypeScript class wrapper.
|
||||||
|
|
@ -40115,13 +40135,21 @@ var ts;
|
||||||
result.mapper = undefined;
|
result.mapper = undefined;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function getOptionalCallSignature(signature) {
|
function getOptionalCallSignature(signature, callChainFlags) {
|
||||||
return signatureIsOptionalCall(signature) ? signature :
|
if ((signature.flags & 12 /* CallChainFlags */) === callChainFlags) {
|
||||||
(signature.optionalCallSignatureCache || (signature.optionalCallSignatureCache = createOptionalCallSignature(signature)));
|
return signature;
|
||||||
}
|
}
|
||||||
function createOptionalCallSignature(signature) {
|
if (!signature.optionalCallSignatureCache) {
|
||||||
|
signature.optionalCallSignatureCache = {};
|
||||||
|
}
|
||||||
|
var key = callChainFlags === 4 /* IsInnerCallChain */ ? "inner" : "outer";
|
||||||
|
return signature.optionalCallSignatureCache[key]
|
||||||
|
|| (signature.optionalCallSignatureCache[key] = createOptionalCallSignature(signature, callChainFlags));
|
||||||
|
}
|
||||||
|
function createOptionalCallSignature(signature, callChainFlags) {
|
||||||
|
ts.Debug.assert(callChainFlags === 4 /* IsInnerCallChain */ || callChainFlags === 8 /* IsOuterCallChain */, "An optional call signature can either be for an inner call chain or an outer call chain, but not both.");
|
||||||
var result = cloneSignature(signature);
|
var result = cloneSignature(signature);
|
||||||
result.flags |= 4 /* IsOptionalCall */;
|
result.flags |= callChainFlags;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function getExpandedParameters(sig) {
|
function getExpandedParameters(sig) {
|
||||||
|
|
@ -41633,9 +41661,12 @@ var ts;
|
||||||
signature.unionSignatures ? getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */) :
|
signature.unionSignatures ? getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */) :
|
||||||
getReturnTypeFromAnnotation(signature.declaration) ||
|
getReturnTypeFromAnnotation(signature.declaration) ||
|
||||||
(ts.nodeIsMissing(signature.declaration.body) ? anyType : getReturnTypeFromBody(signature.declaration));
|
(ts.nodeIsMissing(signature.declaration.body) ? anyType : getReturnTypeFromBody(signature.declaration));
|
||||||
if (signatureIsOptionalCall(signature)) {
|
if (signature.flags & 4 /* IsInnerCallChain */) {
|
||||||
type = addOptionalTypeMarker(type);
|
type = addOptionalTypeMarker(type);
|
||||||
}
|
}
|
||||||
|
else if (signature.flags & 8 /* IsOuterCallChain */) {
|
||||||
|
type = getOptionalType(type);
|
||||||
|
}
|
||||||
if (!popTypeResolution()) {
|
if (!popTypeResolution()) {
|
||||||
if (signature.declaration) {
|
if (signature.declaration) {
|
||||||
var typeNode = ts.getEffectiveReturnTypeNode(signature.declaration);
|
var typeNode = ts.getEffectiveReturnTypeNode(signature.declaration);
|
||||||
|
|
@ -42108,7 +42139,9 @@ var ts;
|
||||||
isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol;
|
isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol;
|
||||||
}
|
}
|
||||||
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
|
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
|
||||||
if (isRequireAlias || node.kind === 187 /* ImportType */ || isDelayedMergeClass) {
|
var isImportTypeWithQualifier = node.kind === 187 /* ImportType */ && node.qualifier;
|
||||||
|
// valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}
|
||||||
|
if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass)) {
|
||||||
typeType = getTypeReferenceType(node, valueType.symbol);
|
typeType = getTypeReferenceType(node, valueType.symbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -47648,8 +47681,8 @@ var ts;
|
||||||
function removeOptionalTypeMarker(type) {
|
function removeOptionalTypeMarker(type) {
|
||||||
return strictNullChecks ? filterType(type, isNotOptionalTypeMarker) : type;
|
return strictNullChecks ? filterType(type, isNotOptionalTypeMarker) : type;
|
||||||
}
|
}
|
||||||
function propagateOptionalTypeMarker(type, wasOptional) {
|
function propagateOptionalTypeMarker(type, node, wasOptional) {
|
||||||
return wasOptional ? addOptionalTypeMarker(type) : type;
|
return wasOptional ? ts.isOutermostOptionalChain(node) ? getOptionalType(type) : addOptionalTypeMarker(type) : type;
|
||||||
}
|
}
|
||||||
function getOptionalExpressionType(exprType, expression) {
|
function getOptionalExpressionType(exprType, expression) {
|
||||||
return ts.isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) :
|
return ts.isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) :
|
||||||
|
|
@ -53276,7 +53309,7 @@ var ts;
|
||||||
function checkPropertyAccessChain(node) {
|
function checkPropertyAccessChain(node) {
|
||||||
var leftType = checkExpression(node.expression);
|
var leftType = checkExpression(node.expression);
|
||||||
var nonOptionalType = getOptionalExpressionType(leftType, node.expression);
|
var nonOptionalType = getOptionalExpressionType(leftType, node.expression);
|
||||||
return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name), nonOptionalType !== leftType);
|
return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name), node, nonOptionalType !== leftType);
|
||||||
}
|
}
|
||||||
function checkQualifiedName(node) {
|
function checkQualifiedName(node) {
|
||||||
return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right);
|
return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right);
|
||||||
|
|
@ -53668,7 +53701,7 @@ var ts;
|
||||||
function checkElementAccessChain(node) {
|
function checkElementAccessChain(node) {
|
||||||
var exprType = checkExpression(node.expression);
|
var exprType = checkExpression(node.expression);
|
||||||
var nonOptionalType = getOptionalExpressionType(exprType, node.expression);
|
var nonOptionalType = getOptionalExpressionType(exprType, node.expression);
|
||||||
return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression)), nonOptionalType !== exprType);
|
return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression)), node, nonOptionalType !== exprType);
|
||||||
}
|
}
|
||||||
function checkElementAccessExpression(node, exprType) {
|
function checkElementAccessExpression(node, exprType) {
|
||||||
var objectType = ts.getAssignmentTargetKind(node) !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType;
|
var objectType = ts.getAssignmentTargetKind(node) !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType;
|
||||||
|
|
@ -53757,7 +53790,7 @@ var ts;
|
||||||
// interface B extends A { (x: 'foo'): string }
|
// interface B extends A { (x: 'foo'): string }
|
||||||
// const b: B;
|
// const b: B;
|
||||||
// b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void]
|
// b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void]
|
||||||
function reorderCandidates(signatures, result, isOptionalCall) {
|
function reorderCandidates(signatures, result, callChainFlags) {
|
||||||
var lastParent;
|
var lastParent;
|
||||||
var lastSymbol;
|
var lastSymbol;
|
||||||
var cutoffIndex = 0;
|
var cutoffIndex = 0;
|
||||||
|
|
@ -53798,7 +53831,7 @@ var ts;
|
||||||
else {
|
else {
|
||||||
spliceIndex = index;
|
spliceIndex = index;
|
||||||
}
|
}
|
||||||
result.splice(spliceIndex, 0, isOptionalCall ? getOptionalCallSignature(signature) : signature);
|
result.splice(spliceIndex, 0, callChainFlags ? getOptionalCallSignature(signature, callChainFlags) : signature);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function isSpreadArgument(arg) {
|
function isSpreadArgument(arg) {
|
||||||
|
|
@ -54388,7 +54421,7 @@ var ts;
|
||||||
}
|
}
|
||||||
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
|
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
|
||||||
}
|
}
|
||||||
function resolveCall(node, signatures, candidatesOutArray, checkMode, isOptionalCall, fallbackError) {
|
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
|
||||||
var isTaggedTemplate = node.kind === 197 /* TaggedTemplateExpression */;
|
var isTaggedTemplate = node.kind === 197 /* TaggedTemplateExpression */;
|
||||||
var isDecorator = node.kind === 156 /* Decorator */;
|
var isDecorator = node.kind === 156 /* Decorator */;
|
||||||
var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
|
var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
|
||||||
|
|
@ -54403,7 +54436,7 @@ var ts;
|
||||||
}
|
}
|
||||||
var candidates = candidatesOutArray || [];
|
var candidates = candidatesOutArray || [];
|
||||||
// reorderCandidates fills up the candidates array directly
|
// reorderCandidates fills up the candidates array directly
|
||||||
reorderCandidates(signatures, candidates, isOptionalCall);
|
reorderCandidates(signatures, candidates, callChainFlags);
|
||||||
if (!candidates.length) {
|
if (!candidates.length) {
|
||||||
if (reportErrors) {
|
if (reportErrors) {
|
||||||
diagnostics.add(getDiagnosticForCallNode(node, ts.Diagnostics.Call_target_does_not_contain_any_signatures));
|
diagnostics.add(getDiagnosticForCallNode(node, ts.Diagnostics.Call_target_does_not_contain_any_signatures));
|
||||||
|
|
@ -54761,20 +54794,22 @@ var ts;
|
||||||
var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));
|
var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));
|
||||||
if (baseTypeNode) {
|
if (baseTypeNode) {
|
||||||
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
|
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
|
||||||
return resolveCall(node, baseConstructors, candidatesOutArray, checkMode, /*isOptional*/ false);
|
return resolveCall(node, baseConstructors, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resolveUntypedCall(node);
|
return resolveUntypedCall(node);
|
||||||
}
|
}
|
||||||
var isOptional;
|
var callChainFlags;
|
||||||
var funcType = checkExpression(node.expression);
|
var funcType = checkExpression(node.expression);
|
||||||
if (ts.isCallChain(node)) {
|
if (ts.isCallChain(node)) {
|
||||||
var nonOptionalType = getOptionalExpressionType(funcType, node.expression);
|
var nonOptionalType = getOptionalExpressionType(funcType, node.expression);
|
||||||
isOptional = nonOptionalType !== funcType;
|
callChainFlags = nonOptionalType === funcType ? 0 /* None */ :
|
||||||
|
ts.isOutermostOptionalChain(node) ? 8 /* IsOuterCallChain */ :
|
||||||
|
4 /* IsInnerCallChain */;
|
||||||
funcType = nonOptionalType;
|
funcType = nonOptionalType;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
isOptional = false;
|
callChainFlags = 0 /* None */;
|
||||||
}
|
}
|
||||||
funcType = checkNonNullTypeWithReporter(funcType, node.expression, reportCannotInvokePossiblyNullOrUndefinedError);
|
funcType = checkNonNullTypeWithReporter(funcType, node.expression, reportCannotInvokePossiblyNullOrUndefinedError);
|
||||||
if (funcType === silentNeverType) {
|
if (funcType === silentNeverType) {
|
||||||
|
|
@ -54842,7 +54877,7 @@ var ts;
|
||||||
error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
|
error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, isOptional);
|
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
|
||||||
}
|
}
|
||||||
function isGenericFunctionReturningFunction(signature) {
|
function isGenericFunctionReturningFunction(signature) {
|
||||||
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
||||||
|
|
@ -54905,7 +54940,7 @@ var ts;
|
||||||
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, constructSignatures, candidatesOutArray, checkMode, /*isOptional*/ false);
|
return resolveCall(node, constructSignatures, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
}
|
}
|
||||||
// If expressionType's apparent type is an object type with no construct signatures but
|
// If expressionType's apparent type is an object type with no construct signatures but
|
||||||
// one or more call signatures, the expression is processed as a function call. A compile-time
|
// one or more call signatures, the expression is processed as a function call. A compile-time
|
||||||
|
|
@ -54913,7 +54948,7 @@ var ts;
|
||||||
// operation is Any. It is an error to have a Void this type.
|
// operation is Any. It is an error to have a Void this type.
|
||||||
var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */);
|
var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */);
|
||||||
if (callSignatures.length) {
|
if (callSignatures.length) {
|
||||||
var signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, /*isOptional*/ false);
|
var signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
if (!noImplicitAny) {
|
if (!noImplicitAny) {
|
||||||
if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) {
|
if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) {
|
||||||
error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);
|
error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);
|
||||||
|
|
@ -55090,7 +55125,7 @@ var ts;
|
||||||
invocationError(node.tag, apparentType, 0 /* Call */);
|
invocationError(node.tag, apparentType, 0 /* Call */);
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, /*isOptional*/ false);
|
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression.
|
* Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression.
|
||||||
|
|
@ -55143,7 +55178,7 @@ var ts;
|
||||||
invocationErrorRecovery(apparentType, 0 /* Call */, diag);
|
invocationErrorRecovery(apparentType, 0 /* Call */, diag);
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, /*isOptional*/ false, headMessage);
|
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */, headMessage);
|
||||||
}
|
}
|
||||||
function createSignatureForJSXIntrinsic(node, result) {
|
function createSignatureForJSXIntrinsic(node, result) {
|
||||||
var namespace = getJsxNamespaceAt(node);
|
var namespace = getJsxNamespaceAt(node);
|
||||||
|
|
@ -55181,7 +55216,7 @@ var ts;
|
||||||
error(node.tagName, ts.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts.getTextOfNode(node.tagName));
|
error(node.tagName, ts.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts.getTextOfNode(node.tagName));
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, signatures, candidatesOutArray, checkMode, /*isOptional*/ false);
|
return resolveCall(node, signatures, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Sometimes, we have a decorator that could accept zero arguments,
|
* Sometimes, we have a decorator that could accept zero arguments,
|
||||||
|
|
@ -57441,6 +57476,18 @@ var ts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
|
||||||
|
var signature = getSingleCallSignature(funcType);
|
||||||
|
if (signature && !signature.typeParameters) {
|
||||||
|
return getReturnTypeOfSignature(signature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
||||||
|
var funcType = checkExpression(expr.expression);
|
||||||
|
var nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
||||||
|
var returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
|
||||||
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Returns the type of an expression. Unlike checkExpression, this function is simply concerned
|
* Returns the type of an expression. Unlike checkExpression, this function is simply concerned
|
||||||
* with computing the type and may not fully check all contained sub-expressions for errors.
|
* with computing the type and may not fully check all contained sub-expressions for errors.
|
||||||
|
|
@ -57452,21 +57499,10 @@ var ts;
|
||||||
// Optimize for the common case of a call to a function with a single non-generic call
|
// Optimize for the common case of a call to a function with a single non-generic call
|
||||||
// signature where we can just fetch the return type without checking the arguments.
|
// signature where we can just fetch the return type without checking the arguments.
|
||||||
if (ts.isCallExpression(expr) && expr.expression.kind !== 101 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) {
|
if (ts.isCallExpression(expr) && expr.expression.kind !== 101 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) {
|
||||||
var isOptional = void 0;
|
var type = ts.isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
||||||
var funcType = void 0;
|
getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
||||||
if (ts.isCallChain(expr)) {
|
if (type) {
|
||||||
funcType = checkExpression(expr.expression);
|
return type;
|
||||||
var nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
||||||
isOptional = funcType !== nonOptionalType;
|
|
||||||
funcType = checkNonNullType(nonOptionalType, expr.expression);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
isOptional = false;
|
|
||||||
funcType = checkNonNullExpression(expr.expression);
|
|
||||||
}
|
|
||||||
var signature = getSingleCallSignature(funcType);
|
|
||||||
if (signature && !signature.typeParameters) {
|
|
||||||
return propagateOptionalTypeMarker(getReturnTypeOfSignature(signature), isOptional);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ts.isAssertionExpression(expr) && !ts.isConstTypeReference(expr.type)) {
|
else if (ts.isAssertionExpression(expr) && !ts.isConstTypeReference(expr.type)) {
|
||||||
|
|
@ -65321,10 +65357,6 @@ var ts;
|
||||||
return !!(s.flags & 2 /* HasLiteralTypes */);
|
return !!(s.flags & 2 /* HasLiteralTypes */);
|
||||||
}
|
}
|
||||||
ts.signatureHasLiteralTypes = signatureHasLiteralTypes;
|
ts.signatureHasLiteralTypes = signatureHasLiteralTypes;
|
||||||
function signatureIsOptionalCall(s) {
|
|
||||||
return !!(s.flags & 4 /* IsOptionalCall */);
|
|
||||||
}
|
|
||||||
ts.signatureIsOptionalCall = signatureIsOptionalCall;
|
|
||||||
})(ts || (ts = {}));
|
})(ts || (ts = {}));
|
||||||
var ts;
|
var ts;
|
||||||
(function (ts) {
|
(function (ts) {
|
||||||
|
|
@ -73316,12 +73348,12 @@ var ts;
|
||||||
for (var _i = 0, parametersWithPropertyAssignments_1 = parametersWithPropertyAssignments; _i < parametersWithPropertyAssignments_1.length; _i++) {
|
for (var _i = 0, parametersWithPropertyAssignments_1 = parametersWithPropertyAssignments; _i < parametersWithPropertyAssignments_1.length; _i++) {
|
||||||
var parameter = parametersWithPropertyAssignments_1[_i];
|
var parameter = parametersWithPropertyAssignments_1[_i];
|
||||||
if (ts.isIdentifier(parameter.name)) {
|
if (ts.isIdentifier(parameter.name)) {
|
||||||
members.push(ts.aggregateTransformFlags(ts.createProperty(
|
members.push(ts.setOriginalNode(ts.aggregateTransformFlags(ts.createProperty(
|
||||||
/*decorators*/ undefined,
|
/*decorators*/ undefined,
|
||||||
/*modifiers*/ undefined, parameter.name,
|
/*modifiers*/ undefined, parameter.name,
|
||||||
/*questionOrExclamationToken*/ undefined,
|
/*questionOrExclamationToken*/ undefined,
|
||||||
/*type*/ undefined,
|
/*type*/ undefined,
|
||||||
/*initializer*/ undefined)));
|
/*initializer*/ undefined)), parameter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -74136,6 +74168,9 @@ var ts;
|
||||||
return !ts.nodeIsMissing(node.body);
|
return !ts.nodeIsMissing(node.body);
|
||||||
}
|
}
|
||||||
function visitPropertyDeclaration(node) {
|
function visitPropertyDeclaration(node) {
|
||||||
|
if (node.flags & 8388608 /* Ambient */) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
var updated = ts.updateProperty(node,
|
var updated = ts.updateProperty(node,
|
||||||
/*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), visitPropertyNameOfClassElement(node),
|
/*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), visitPropertyNameOfClassElement(node),
|
||||||
/*questionOrExclamationToken*/ undefined,
|
/*questionOrExclamationToken*/ undefined,
|
||||||
|
|
@ -74520,7 +74555,12 @@ var ts;
|
||||||
*
|
*
|
||||||
* @param node The module declaration node.
|
* @param node The module declaration node.
|
||||||
*/
|
*/
|
||||||
function shouldEmitModuleDeclaration(node) {
|
function shouldEmitModuleDeclaration(nodeIn) {
|
||||||
|
var node = ts.getParseTreeNode(nodeIn, ts.isModuleDeclaration);
|
||||||
|
if (!node) {
|
||||||
|
// If we can't find a parse tree node, assume the node is instantiated.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return ts.isInstantiatedModule(node, !!compilerOptions.preserveConstEnums || !!compilerOptions.isolatedModules);
|
return ts.isInstantiatedModule(node, !!compilerOptions.preserveConstEnums || !!compilerOptions.isolatedModules);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
@ -75244,9 +75284,9 @@ var ts;
|
||||||
/**
|
/**
|
||||||
* Transforms ECMAScript Class Syntax.
|
* Transforms ECMAScript Class Syntax.
|
||||||
* TypeScript parameter property syntax is transformed in the TypeScript transformer.
|
* TypeScript parameter property syntax is transformed in the TypeScript transformer.
|
||||||
* For now, this transforms public field declarations using TypeScript class semantics
|
* For now, this transforms public field declarations using TypeScript class semantics,
|
||||||
* (where the declarations get elided and initializers are transformed as assignments in the constructor).
|
* where declarations are elided and initializers are transformed as assignments in the constructor.
|
||||||
* Eventually, this transform will change to the ECMAScript semantics (with Object.defineProperty).
|
* When --useDefineForClassFields is on, this transforms to ECMAScript semantics, with Object.defineProperty.
|
||||||
*/
|
*/
|
||||||
function transformClassFields(context) {
|
function transformClassFields(context) {
|
||||||
var hoistVariableDeclaration = context.hoistVariableDeclaration, endLexicalEnvironment = context.endLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment;
|
var hoistVariableDeclaration = context.hoistVariableDeclaration, endLexicalEnvironment = context.endLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment;
|
||||||
|
|
@ -75457,7 +75497,9 @@ var ts;
|
||||||
/*modifiers*/ undefined, parameters, body), constructor || node), constructor));
|
/*modifiers*/ undefined, parameters, body), constructor || node), constructor));
|
||||||
}
|
}
|
||||||
function transformConstructorBody(node, constructor, isDerivedClass) {
|
function transformConstructorBody(node, constructor, isDerivedClass) {
|
||||||
var properties = ts.getProperties(node, /*requireInitializer*/ !context.getCompilerOptions().useDefineForClassFields, /*isStatic*/ false);
|
var _a;
|
||||||
|
var useDefineForClassFields = context.getCompilerOptions().useDefineForClassFields;
|
||||||
|
var properties = ts.getProperties(node, /*requireInitializer*/ !useDefineForClassFields, /*isStatic*/ false);
|
||||||
// Only generate synthetic constructor when there are property initializers to move.
|
// Only generate synthetic constructor when there are property initializers to move.
|
||||||
if (!constructor && !ts.some(properties)) {
|
if (!constructor && !ts.some(properties)) {
|
||||||
return ts.visitFunctionBody(/*node*/ undefined, visitor, context);
|
return ts.visitFunctionBody(/*node*/ undefined, visitor, context);
|
||||||
|
|
@ -75486,19 +75528,16 @@ var ts;
|
||||||
// this.x = 1;
|
// this.x = 1;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
if (constructor && constructor.body) {
|
if ((_a = constructor) === null || _a === void 0 ? void 0 : _a.body) {
|
||||||
var parameterPropertyDeclarationCount = 0;
|
var afterParameterProperties = ts.findIndex(constructor.body.statements, function (s) { return !ts.isParameterPropertyDeclaration(ts.getOriginalNode(s), constructor); }, indexOfFirstStatement);
|
||||||
for (var i = indexOfFirstStatement; i < constructor.body.statements.length; i++) {
|
if (afterParameterProperties === -1) {
|
||||||
if (ts.isParameterPropertyDeclaration(ts.getOriginalNode(constructor.body.statements[i]), constructor)) {
|
afterParameterProperties = constructor.body.statements.length;
|
||||||
parameterPropertyDeclarationCount++;
|
|
||||||
}
|
}
|
||||||
else {
|
if (afterParameterProperties > indexOfFirstStatement) {
|
||||||
break;
|
if (!useDefineForClassFields) {
|
||||||
|
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement, afterParameterProperties - indexOfFirstStatement));
|
||||||
}
|
}
|
||||||
}
|
indexOfFirstStatement = afterParameterProperties;
|
||||||
if (parameterPropertyDeclarationCount > 0) {
|
|
||||||
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement, parameterPropertyDeclarationCount));
|
|
||||||
indexOfFirstStatement += parameterPropertyDeclarationCount;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addPropertyStatements(statements, properties, ts.createThis());
|
addPropertyStatements(statements, properties, ts.createThis());
|
||||||
|
|
@ -75559,7 +75598,9 @@ var ts;
|
||||||
var propertyName = ts.isComputedPropertyName(property.name) && !ts.isSimpleInlineableExpression(property.name.expression)
|
var propertyName = ts.isComputedPropertyName(property.name) && !ts.isSimpleInlineableExpression(property.name.expression)
|
||||||
? ts.updateComputedPropertyName(property.name, ts.getGeneratedNameForNode(property.name))
|
? ts.updateComputedPropertyName(property.name, ts.getGeneratedNameForNode(property.name))
|
||||||
: property.name;
|
: property.name;
|
||||||
var initializer = property.initializer || emitAssignment ? ts.visitNode(property.initializer, visitor, ts.isExpression) : ts.createVoidZero();
|
var initializer = property.initializer || emitAssignment ? ts.visitNode(property.initializer, visitor, ts.isExpression)
|
||||||
|
: ts.hasModifier(ts.getOriginalNode(property), 92 /* ParameterPropertyModifier */) && ts.isIdentifier(propertyName) ? propertyName
|
||||||
|
: ts.createVoidZero();
|
||||||
if (emitAssignment) {
|
if (emitAssignment) {
|
||||||
var memberAccess = ts.createMemberAccessForPropertyName(receiver, propertyName, /*location*/ propertyName);
|
var memberAccess = ts.createMemberAccessForPropertyName(receiver, propertyName, /*location*/ propertyName);
|
||||||
return ts.createAssignment(memberAccess, initializer);
|
return ts.createAssignment(memberAccess, initializer);
|
||||||
|
|
@ -88786,7 +88827,7 @@ var ts;
|
||||||
*/
|
*/
|
||||||
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
|
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
|
||||||
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
|
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
|
||||||
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
|
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);
|
||||||
var options = host.getCompilerOptions();
|
var options = host.getCompilerOptions();
|
||||||
if (options.outFile || options.out) {
|
if (options.outFile || options.out) {
|
||||||
var prepends = host.getPrependNodes();
|
var prepends = host.getPrependNodes();
|
||||||
|
|
@ -89030,7 +89071,7 @@ var ts;
|
||||||
var exportedModulesFromDeclarationEmit;
|
var exportedModulesFromDeclarationEmit;
|
||||||
// Emit each output file
|
// Emit each output file
|
||||||
enter();
|
enter();
|
||||||
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
|
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
|
||||||
exit();
|
exit();
|
||||||
return {
|
return {
|
||||||
emitSkipped: emitSkipped,
|
emitSkipped: emitSkipped,
|
||||||
|
|
@ -89418,6 +89459,7 @@ var ts;
|
||||||
getLibFileFromReference: ts.notImplemented,
|
getLibFileFromReference: ts.notImplemented,
|
||||||
isSourceFileFromExternalLibrary: ts.returnFalse,
|
isSourceFileFromExternalLibrary: ts.returnFalse,
|
||||||
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
|
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
|
||||||
|
isSourceOfProjectReferenceRedirect: ts.returnFalse,
|
||||||
writeFile: function (name, text, writeByteOrderMark) {
|
writeFile: function (name, text, writeByteOrderMark) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case jsFilePath:
|
case jsFilePath:
|
||||||
|
|
@ -94534,14 +94576,9 @@ var ts;
|
||||||
function toPath(fileName) {
|
function toPath(fileName) {
|
||||||
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
|
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||||
}
|
}
|
||||||
function isValidSourceFileForEmit(file) {
|
|
||||||
// source file is allowed to be emitted and its not source of project reference redirect
|
|
||||||
return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) &&
|
|
||||||
!isSourceOfProjectReferenceRedirect(file.fileName);
|
|
||||||
}
|
|
||||||
function getCommonSourceDirectory() {
|
function getCommonSourceDirectory() {
|
||||||
if (commonSourceDirectory === undefined) {
|
if (commonSourceDirectory === undefined) {
|
||||||
var emittedFiles = ts.filter(files, function (file) { return isValidSourceFileForEmit(file); });
|
var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });
|
||||||
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
|
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
|
||||||
// If a rootDir is specified use it as the commonSourceDirectory
|
// If a rootDir is specified use it as the commonSourceDirectory
|
||||||
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
|
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
|
||||||
|
|
@ -94944,6 +94981,7 @@ var ts;
|
||||||
return __assign(__assign({ getPrependNodes: getPrependNodes,
|
return __assign(__assign({ getPrependNodes: getPrependNodes,
|
||||||
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
|
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
|
||||||
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
|
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
|
||||||
|
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
|
||||||
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
|
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
|
||||||
// Use local caches
|
// Use local caches
|
||||||
var path = toPath(f);
|
var path = toPath(f);
|
||||||
|
|
@ -96164,7 +96202,7 @@ var ts;
|
||||||
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
|
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
|
||||||
var file = files_3[_i];
|
var file = files_3[_i];
|
||||||
// Ignore file that is not emitted
|
// Ignore file that is not emitted
|
||||||
if (isValidSourceFileForEmit(file) && !rootPaths.has(file.path)) {
|
if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
|
||||||
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
|
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -96187,7 +96225,7 @@ var ts;
|
||||||
var typeOfSubst = typeof subst;
|
var typeOfSubst = typeof subst;
|
||||||
if (typeOfSubst === "string") {
|
if (typeOfSubst === "string") {
|
||||||
if (!ts.hasZeroOrOneAsteriskCharacter(subst)) {
|
if (!ts.hasZeroOrOneAsteriskCharacter(subst)) {
|
||||||
createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character, subst, key);
|
createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -104184,10 +104222,11 @@ var ts;
|
||||||
}
|
}
|
||||||
var dependencyKeys = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"];
|
var dependencyKeys = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"];
|
||||||
var stringContent = host.readFile(fileName);
|
var stringContent = host.readFile(fileName);
|
||||||
var content = stringContent && tryParseJson(stringContent);
|
if (!stringContent)
|
||||||
if (!content) {
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
var content = tryParseJson(stringContent);
|
||||||
|
if (!content)
|
||||||
|
return false;
|
||||||
var info = {};
|
var info = {};
|
||||||
for (var _i = 0, dependencyKeys_1 = dependencyKeys; _i < dependencyKeys_1.length; _i++) {
|
for (var _i = 0, dependencyKeys_1 = dependencyKeys; _i < dependencyKeys_1.length; _i++) {
|
||||||
var key = dependencyKeys_1[_i];
|
var key = dependencyKeys_1[_i];
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ var ts;
|
||||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||||
ts.versionMajorMinor = "3.7";
|
ts.versionMajorMinor = "3.7";
|
||||||
/** The version of the TypeScript compiler release */
|
/** The version of the TypeScript compiler release */
|
||||||
ts.version = ts.versionMajorMinor + ".2";
|
ts.version = ts.versionMajorMinor + ".3";
|
||||||
})(ts || (ts = {}));
|
})(ts || (ts = {}));
|
||||||
(function (ts) {
|
(function (ts) {
|
||||||
/* @internal */
|
/* @internal */
|
||||||
|
|
@ -3942,11 +3942,13 @@ var ts;
|
||||||
SignatureFlags[SignatureFlags["None"] = 0] = "None";
|
SignatureFlags[SignatureFlags["None"] = 0] = "None";
|
||||||
SignatureFlags[SignatureFlags["HasRestParameter"] = 1] = "HasRestParameter";
|
SignatureFlags[SignatureFlags["HasRestParameter"] = 1] = "HasRestParameter";
|
||||||
SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes";
|
SignatureFlags[SignatureFlags["HasLiteralTypes"] = 2] = "HasLiteralTypes";
|
||||||
SignatureFlags[SignatureFlags["IsOptionalCall"] = 4] = "IsOptionalCall";
|
SignatureFlags[SignatureFlags["IsInnerCallChain"] = 4] = "IsInnerCallChain";
|
||||||
// We do not propagate `IsOptionalCall` to instantiated signatures, as that would result in us
|
SignatureFlags[SignatureFlags["IsOuterCallChain"] = 8] = "IsOuterCallChain";
|
||||||
|
// We do not propagate `IsInnerCallChain` to instantiated signatures, as that would result in us
|
||||||
// attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when
|
// attempting to add `| undefined` on each recursive call to `getReturnTypeOfSignature` when
|
||||||
// instantiating the return type.
|
// instantiating the return type.
|
||||||
SignatureFlags[SignatureFlags["PropagatingFlags"] = 3] = "PropagatingFlags";
|
SignatureFlags[SignatureFlags["PropagatingFlags"] = 3] = "PropagatingFlags";
|
||||||
|
SignatureFlags[SignatureFlags["CallChainFlags"] = 12] = "CallChainFlags";
|
||||||
})(SignatureFlags = ts.SignatureFlags || (ts.SignatureFlags = {}));
|
})(SignatureFlags = ts.SignatureFlags || (ts.SignatureFlags = {}));
|
||||||
var IndexKind;
|
var IndexKind;
|
||||||
(function (IndexKind) {
|
(function (IndexKind) {
|
||||||
|
|
@ -6486,7 +6488,7 @@ var ts;
|
||||||
Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),
|
Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),
|
||||||
Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."),
|
Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."),
|
||||||
Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."),
|
Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."),
|
||||||
Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' in can have at most one '*' character."),
|
Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."),
|
||||||
Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."),
|
Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."),
|
||||||
Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, ts.DiagnosticCategory.Error, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),
|
Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, ts.DiagnosticCategory.Error, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),
|
||||||
File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),
|
File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),
|
||||||
|
|
@ -12485,30 +12487,31 @@ var ts;
|
||||||
* @param host An EmitHost.
|
* @param host An EmitHost.
|
||||||
* @param targetSourceFile An optional target source file to emit.
|
* @param targetSourceFile An optional target source file to emit.
|
||||||
*/
|
*/
|
||||||
function getSourceFilesToEmit(host, targetSourceFile) {
|
function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) {
|
||||||
var options = host.getCompilerOptions();
|
var options = host.getCompilerOptions();
|
||||||
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
|
|
||||||
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
|
|
||||||
if (options.outFile || options.out) {
|
if (options.outFile || options.out) {
|
||||||
var moduleKind = ts.getEmitModuleKind(options);
|
var moduleKind = ts.getEmitModuleKind(options);
|
||||||
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
|
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
|
||||||
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
|
// Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified
|
||||||
return ts.filter(host.getSourceFiles(), function (sourceFile) {
|
return ts.filter(host.getSourceFiles(), function (sourceFile) {
|
||||||
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect);
|
return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) &&
|
||||||
|
sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
|
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
|
||||||
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect); });
|
return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ts.getSourceFilesToEmit = getSourceFilesToEmit;
|
ts.getSourceFilesToEmit = getSourceFilesToEmit;
|
||||||
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
|
/** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */
|
||||||
function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
|
function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) {
|
||||||
|
var options = host.getCompilerOptions();
|
||||||
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
|
return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
|
||||||
!sourceFile.isDeclarationFile &&
|
!sourceFile.isDeclarationFile &&
|
||||||
!isSourceFileFromExternalLibrary(sourceFile) &&
|
!host.isSourceFileFromExternalLibrary(sourceFile) &&
|
||||||
!(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
|
!(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) &&
|
||||||
|
(forceDtsEmit || !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName));
|
||||||
}
|
}
|
||||||
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
|
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
|
||||||
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
|
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
|
||||||
|
|
@ -14600,14 +14603,36 @@ var ts;
|
||||||
|| kind === 195 /* CallExpression */);
|
|| kind === 195 /* CallExpression */);
|
||||||
}
|
}
|
||||||
ts.isOptionalChain = isOptionalChain;
|
ts.isOptionalChain = isOptionalChain;
|
||||||
|
/* @internal */
|
||||||
|
function isOptionalChainRoot(node) {
|
||||||
|
return isOptionalChain(node) && !!node.questionDotToken;
|
||||||
|
}
|
||||||
|
ts.isOptionalChainRoot = isOptionalChainRoot;
|
||||||
/**
|
/**
|
||||||
* Determines whether a node is the expression preceding an optional chain (i.e. `a` in `a?.b`).
|
* Determines whether a node is the expression preceding an optional chain (i.e. `a` in `a?.b`).
|
||||||
*/
|
*/
|
||||||
/* @internal */
|
/* @internal */
|
||||||
function isExpressionOfOptionalChainRoot(node) {
|
function isExpressionOfOptionalChainRoot(node) {
|
||||||
return ts.isOptionalChainRoot(node.parent) && node.parent.expression === node;
|
return isOptionalChainRoot(node.parent) && node.parent.expression === node;
|
||||||
}
|
}
|
||||||
ts.isExpressionOfOptionalChainRoot = isExpressionOfOptionalChainRoot;
|
ts.isExpressionOfOptionalChainRoot = isExpressionOfOptionalChainRoot;
|
||||||
|
/**
|
||||||
|
* Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`:
|
||||||
|
*
|
||||||
|
* 1. For `a?.b.c`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.`)
|
||||||
|
* 2. For `(a?.b.c).d`, the outermost chain is `a?.b.c` (`c` is the end of the chain starting at `a?.` since parens end the chain)
|
||||||
|
* 3. For `a?.b.c?.d`, both `a?.b.c` and `a?.b.c?.d` are outermost (`c` is the end of the chain starting at `a?.`, and `d` is
|
||||||
|
* the end of the chain starting at `c?.`)
|
||||||
|
* 4. For `a?.(b?.c).d`, both `b?.c` and `a?.(b?.c)d` are outermost (`c` is the end of the chain starting at `b`, and `d` is
|
||||||
|
* the end of the chain starting at `a?.`)
|
||||||
|
*/
|
||||||
|
/* @internal */
|
||||||
|
function isOutermostOptionalChain(node) {
|
||||||
|
return !isOptionalChain(node.parent) // cases 1 and 2
|
||||||
|
|| isOptionalChainRoot(node.parent) // case 3
|
||||||
|
|| node !== node.parent.expression; // case 4
|
||||||
|
}
|
||||||
|
ts.isOutermostOptionalChain = isOutermostOptionalChain;
|
||||||
function isNullishCoalesce(node) {
|
function isNullishCoalesce(node) {
|
||||||
return node.kind === 208 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
|
return node.kind === 208 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */;
|
||||||
}
|
}
|
||||||
|
|
@ -15882,11 +15907,6 @@ var ts;
|
||||||
return node.kind === 162 /* GetAccessor */;
|
return node.kind === 162 /* GetAccessor */;
|
||||||
}
|
}
|
||||||
ts.isGetAccessor = isGetAccessor;
|
ts.isGetAccessor = isGetAccessor;
|
||||||
/* @internal */
|
|
||||||
function isOptionalChainRoot(node) {
|
|
||||||
return ts.isOptionalChain(node) && !!node.questionDotToken;
|
|
||||||
}
|
|
||||||
ts.isOptionalChainRoot = isOptionalChainRoot;
|
|
||||||
/** True if has jsdoc nodes attached to it. */
|
/** True if has jsdoc nodes attached to it. */
|
||||||
/* @internal */
|
/* @internal */
|
||||||
// TODO: GH#19856 Would like to return `node is Node & { jsDoc: JSDoc[] }` but it causes long compile times
|
// TODO: GH#19856 Would like to return `node is Node & { jsDoc: JSDoc[] }` but it causes long compile times
|
||||||
|
|
@ -16787,6 +16807,8 @@ var ts;
|
||||||
var patterns = [];
|
var patterns = [];
|
||||||
for (var _i = 0, patternStrings_1 = patternStrings; _i < patternStrings_1.length; _i++) {
|
for (var _i = 0, patternStrings_1 = patternStrings; _i < patternStrings_1.length; _i++) {
|
||||||
var patternString = patternStrings_1[_i];
|
var patternString = patternStrings_1[_i];
|
||||||
|
if (!ts.hasZeroOrOneAsteriskCharacter(patternString))
|
||||||
|
continue;
|
||||||
var pattern = tryParsePattern(patternString);
|
var pattern = tryParsePattern(patternString);
|
||||||
if (pattern) {
|
if (pattern) {
|
||||||
patterns.push(pattern);
|
patterns.push(pattern);
|
||||||
|
|
@ -29221,7 +29243,7 @@ var ts;
|
||||||
}
|
}
|
||||||
function bindCondition(node, trueTarget, falseTarget) {
|
function bindCondition(node, trueTarget, falseTarget) {
|
||||||
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
||||||
if (!node || !isLogicalExpression(node) && !(ts.isOptionalChain(node) && isOutermostOptionalChain(node))) {
|
if (!node || !isLogicalExpression(node) && !(ts.isOptionalChain(node) && ts.isOutermostOptionalChain(node))) {
|
||||||
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
||||||
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
||||||
}
|
}
|
||||||
|
|
@ -29693,12 +29715,9 @@ var ts;
|
||||||
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
|
addDeclarationToSymbol(host.symbol, host, 32 /* Class */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function isOutermostOptionalChain(node) {
|
|
||||||
return !ts.isOptionalChain(node.parent) || ts.isOptionalChainRoot(node.parent) || node !== node.parent.expression;
|
|
||||||
}
|
|
||||||
function bindOptionalExpression(node, trueTarget, falseTarget) {
|
function bindOptionalExpression(node, trueTarget, falseTarget) {
|
||||||
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
doWithConditionalBranches(bind, node, trueTarget, falseTarget);
|
||||||
if (!ts.isOptionalChain(node) || isOutermostOptionalChain(node)) {
|
if (!ts.isOptionalChain(node) || ts.isOutermostOptionalChain(node)) {
|
||||||
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
||||||
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
||||||
}
|
}
|
||||||
|
|
@ -29736,7 +29755,7 @@ var ts;
|
||||||
currentFlow = finishFlowLabel(preChainLabel);
|
currentFlow = finishFlowLabel(preChainLabel);
|
||||||
}
|
}
|
||||||
doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget);
|
doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget);
|
||||||
if (isOutermostOptionalChain(node)) {
|
if (ts.isOutermostOptionalChain(node)) {
|
||||||
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node));
|
||||||
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node));
|
||||||
}
|
}
|
||||||
|
|
@ -30821,7 +30840,7 @@ var ts;
|
||||||
}
|
}
|
||||||
function bindObjectDefinePrototypeProperty(node) {
|
function bindObjectDefinePrototypeProperty(node) {
|
||||||
var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression);
|
var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression);
|
||||||
if (namespaceSymbol) {
|
if (namespaceSymbol && namespaceSymbol.valueDeclaration) {
|
||||||
// Ensure the namespace symbol becomes class-like
|
// Ensure the namespace symbol becomes class-like
|
||||||
addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */);
|
addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */);
|
||||||
}
|
}
|
||||||
|
|
@ -31548,7 +31567,8 @@ var ts;
|
||||||
|| ts.hasModifier(node, 2270 /* TypeScriptModifier */)
|
|| ts.hasModifier(node, 2270 /* TypeScriptModifier */)
|
||||||
|| node.typeParameters
|
|| node.typeParameters
|
||||||
|| node.type
|
|| node.type
|
||||||
|| !node.body) {
|
|| !node.body
|
||||||
|
|| node.questionToken) {
|
||||||
transformFlags |= 1 /* AssertTypeScript */;
|
transformFlags |= 1 /* AssertTypeScript */;
|
||||||
}
|
}
|
||||||
// function declarations with object rest destructuring are ES2018 syntax
|
// function declarations with object rest destructuring are ES2018 syntax
|
||||||
|
|
@ -31585,7 +31605,7 @@ var ts;
|
||||||
function computePropertyDeclaration(node, subtreeFlags) {
|
function computePropertyDeclaration(node, subtreeFlags) {
|
||||||
var transformFlags = subtreeFlags | 1048576 /* ContainsClassFields */;
|
var transformFlags = subtreeFlags | 1048576 /* ContainsClassFields */;
|
||||||
// Decorators, TypeScript-specific modifiers, and type annotations are TypeScript syntax.
|
// Decorators, TypeScript-specific modifiers, and type annotations are TypeScript syntax.
|
||||||
if (ts.some(node.decorators) || ts.hasModifier(node, 2270 /* TypeScriptModifier */) || node.type) {
|
if (ts.some(node.decorators) || ts.hasModifier(node, 2270 /* TypeScriptModifier */) || node.type || node.questionToken) {
|
||||||
transformFlags |= 1 /* AssertTypeScript */;
|
transformFlags |= 1 /* AssertTypeScript */;
|
||||||
}
|
}
|
||||||
// Hoisted variables related to class properties should live within the TypeScript class wrapper.
|
// Hoisted variables related to class properties should live within the TypeScript class wrapper.
|
||||||
|
|
@ -40115,13 +40135,21 @@ var ts;
|
||||||
result.mapper = undefined;
|
result.mapper = undefined;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function getOptionalCallSignature(signature) {
|
function getOptionalCallSignature(signature, callChainFlags) {
|
||||||
return signatureIsOptionalCall(signature) ? signature :
|
if ((signature.flags & 12 /* CallChainFlags */) === callChainFlags) {
|
||||||
(signature.optionalCallSignatureCache || (signature.optionalCallSignatureCache = createOptionalCallSignature(signature)));
|
return signature;
|
||||||
}
|
}
|
||||||
function createOptionalCallSignature(signature) {
|
if (!signature.optionalCallSignatureCache) {
|
||||||
|
signature.optionalCallSignatureCache = {};
|
||||||
|
}
|
||||||
|
var key = callChainFlags === 4 /* IsInnerCallChain */ ? "inner" : "outer";
|
||||||
|
return signature.optionalCallSignatureCache[key]
|
||||||
|
|| (signature.optionalCallSignatureCache[key] = createOptionalCallSignature(signature, callChainFlags));
|
||||||
|
}
|
||||||
|
function createOptionalCallSignature(signature, callChainFlags) {
|
||||||
|
ts.Debug.assert(callChainFlags === 4 /* IsInnerCallChain */ || callChainFlags === 8 /* IsOuterCallChain */, "An optional call signature can either be for an inner call chain or an outer call chain, but not both.");
|
||||||
var result = cloneSignature(signature);
|
var result = cloneSignature(signature);
|
||||||
result.flags |= 4 /* IsOptionalCall */;
|
result.flags |= callChainFlags;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
function getExpandedParameters(sig) {
|
function getExpandedParameters(sig) {
|
||||||
|
|
@ -41633,9 +41661,12 @@ var ts;
|
||||||
signature.unionSignatures ? getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */) :
|
signature.unionSignatures ? getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */) :
|
||||||
getReturnTypeFromAnnotation(signature.declaration) ||
|
getReturnTypeFromAnnotation(signature.declaration) ||
|
||||||
(ts.nodeIsMissing(signature.declaration.body) ? anyType : getReturnTypeFromBody(signature.declaration));
|
(ts.nodeIsMissing(signature.declaration.body) ? anyType : getReturnTypeFromBody(signature.declaration));
|
||||||
if (signatureIsOptionalCall(signature)) {
|
if (signature.flags & 4 /* IsInnerCallChain */) {
|
||||||
type = addOptionalTypeMarker(type);
|
type = addOptionalTypeMarker(type);
|
||||||
}
|
}
|
||||||
|
else if (signature.flags & 8 /* IsOuterCallChain */) {
|
||||||
|
type = getOptionalType(type);
|
||||||
|
}
|
||||||
if (!popTypeResolution()) {
|
if (!popTypeResolution()) {
|
||||||
if (signature.declaration) {
|
if (signature.declaration) {
|
||||||
var typeNode = ts.getEffectiveReturnTypeNode(signature.declaration);
|
var typeNode = ts.getEffectiveReturnTypeNode(signature.declaration);
|
||||||
|
|
@ -42108,7 +42139,9 @@ var ts;
|
||||||
isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol;
|
isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol;
|
||||||
}
|
}
|
||||||
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
|
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
|
||||||
if (isRequireAlias || node.kind === 187 /* ImportType */ || isDelayedMergeClass) {
|
var isImportTypeWithQualifier = node.kind === 187 /* ImportType */ && node.qualifier;
|
||||||
|
// valueType might not have a symbol, eg, {import('./b').STRING_LITERAL}
|
||||||
|
if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass)) {
|
||||||
typeType = getTypeReferenceType(node, valueType.symbol);
|
typeType = getTypeReferenceType(node, valueType.symbol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -47648,8 +47681,8 @@ var ts;
|
||||||
function removeOptionalTypeMarker(type) {
|
function removeOptionalTypeMarker(type) {
|
||||||
return strictNullChecks ? filterType(type, isNotOptionalTypeMarker) : type;
|
return strictNullChecks ? filterType(type, isNotOptionalTypeMarker) : type;
|
||||||
}
|
}
|
||||||
function propagateOptionalTypeMarker(type, wasOptional) {
|
function propagateOptionalTypeMarker(type, node, wasOptional) {
|
||||||
return wasOptional ? addOptionalTypeMarker(type) : type;
|
return wasOptional ? ts.isOutermostOptionalChain(node) ? getOptionalType(type) : addOptionalTypeMarker(type) : type;
|
||||||
}
|
}
|
||||||
function getOptionalExpressionType(exprType, expression) {
|
function getOptionalExpressionType(exprType, expression) {
|
||||||
return ts.isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) :
|
return ts.isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) :
|
||||||
|
|
@ -53276,7 +53309,7 @@ var ts;
|
||||||
function checkPropertyAccessChain(node) {
|
function checkPropertyAccessChain(node) {
|
||||||
var leftType = checkExpression(node.expression);
|
var leftType = checkExpression(node.expression);
|
||||||
var nonOptionalType = getOptionalExpressionType(leftType, node.expression);
|
var nonOptionalType = getOptionalExpressionType(leftType, node.expression);
|
||||||
return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name), nonOptionalType !== leftType);
|
return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name), node, nonOptionalType !== leftType);
|
||||||
}
|
}
|
||||||
function checkQualifiedName(node) {
|
function checkQualifiedName(node) {
|
||||||
return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right);
|
return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right);
|
||||||
|
|
@ -53668,7 +53701,7 @@ var ts;
|
||||||
function checkElementAccessChain(node) {
|
function checkElementAccessChain(node) {
|
||||||
var exprType = checkExpression(node.expression);
|
var exprType = checkExpression(node.expression);
|
||||||
var nonOptionalType = getOptionalExpressionType(exprType, node.expression);
|
var nonOptionalType = getOptionalExpressionType(exprType, node.expression);
|
||||||
return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression)), nonOptionalType !== exprType);
|
return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression)), node, nonOptionalType !== exprType);
|
||||||
}
|
}
|
||||||
function checkElementAccessExpression(node, exprType) {
|
function checkElementAccessExpression(node, exprType) {
|
||||||
var objectType = ts.getAssignmentTargetKind(node) !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType;
|
var objectType = ts.getAssignmentTargetKind(node) !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType;
|
||||||
|
|
@ -53757,7 +53790,7 @@ var ts;
|
||||||
// interface B extends A { (x: 'foo'): string }
|
// interface B extends A { (x: 'foo'): string }
|
||||||
// const b: B;
|
// const b: B;
|
||||||
// b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void]
|
// b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void]
|
||||||
function reorderCandidates(signatures, result, isOptionalCall) {
|
function reorderCandidates(signatures, result, callChainFlags) {
|
||||||
var lastParent;
|
var lastParent;
|
||||||
var lastSymbol;
|
var lastSymbol;
|
||||||
var cutoffIndex = 0;
|
var cutoffIndex = 0;
|
||||||
|
|
@ -53798,7 +53831,7 @@ var ts;
|
||||||
else {
|
else {
|
||||||
spliceIndex = index;
|
spliceIndex = index;
|
||||||
}
|
}
|
||||||
result.splice(spliceIndex, 0, isOptionalCall ? getOptionalCallSignature(signature) : signature);
|
result.splice(spliceIndex, 0, callChainFlags ? getOptionalCallSignature(signature, callChainFlags) : signature);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function isSpreadArgument(arg) {
|
function isSpreadArgument(arg) {
|
||||||
|
|
@ -54388,7 +54421,7 @@ var ts;
|
||||||
}
|
}
|
||||||
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
|
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
|
||||||
}
|
}
|
||||||
function resolveCall(node, signatures, candidatesOutArray, checkMode, isOptionalCall, fallbackError) {
|
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
|
||||||
var isTaggedTemplate = node.kind === 197 /* TaggedTemplateExpression */;
|
var isTaggedTemplate = node.kind === 197 /* TaggedTemplateExpression */;
|
||||||
var isDecorator = node.kind === 156 /* Decorator */;
|
var isDecorator = node.kind === 156 /* Decorator */;
|
||||||
var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
|
var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
|
||||||
|
|
@ -54403,7 +54436,7 @@ var ts;
|
||||||
}
|
}
|
||||||
var candidates = candidatesOutArray || [];
|
var candidates = candidatesOutArray || [];
|
||||||
// reorderCandidates fills up the candidates array directly
|
// reorderCandidates fills up the candidates array directly
|
||||||
reorderCandidates(signatures, candidates, isOptionalCall);
|
reorderCandidates(signatures, candidates, callChainFlags);
|
||||||
if (!candidates.length) {
|
if (!candidates.length) {
|
||||||
if (reportErrors) {
|
if (reportErrors) {
|
||||||
diagnostics.add(getDiagnosticForCallNode(node, ts.Diagnostics.Call_target_does_not_contain_any_signatures));
|
diagnostics.add(getDiagnosticForCallNode(node, ts.Diagnostics.Call_target_does_not_contain_any_signatures));
|
||||||
|
|
@ -54761,20 +54794,22 @@ var ts;
|
||||||
var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));
|
var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));
|
||||||
if (baseTypeNode) {
|
if (baseTypeNode) {
|
||||||
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
|
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
|
||||||
return resolveCall(node, baseConstructors, candidatesOutArray, checkMode, /*isOptional*/ false);
|
return resolveCall(node, baseConstructors, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resolveUntypedCall(node);
|
return resolveUntypedCall(node);
|
||||||
}
|
}
|
||||||
var isOptional;
|
var callChainFlags;
|
||||||
var funcType = checkExpression(node.expression);
|
var funcType = checkExpression(node.expression);
|
||||||
if (ts.isCallChain(node)) {
|
if (ts.isCallChain(node)) {
|
||||||
var nonOptionalType = getOptionalExpressionType(funcType, node.expression);
|
var nonOptionalType = getOptionalExpressionType(funcType, node.expression);
|
||||||
isOptional = nonOptionalType !== funcType;
|
callChainFlags = nonOptionalType === funcType ? 0 /* None */ :
|
||||||
|
ts.isOutermostOptionalChain(node) ? 8 /* IsOuterCallChain */ :
|
||||||
|
4 /* IsInnerCallChain */;
|
||||||
funcType = nonOptionalType;
|
funcType = nonOptionalType;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
isOptional = false;
|
callChainFlags = 0 /* None */;
|
||||||
}
|
}
|
||||||
funcType = checkNonNullTypeWithReporter(funcType, node.expression, reportCannotInvokePossiblyNullOrUndefinedError);
|
funcType = checkNonNullTypeWithReporter(funcType, node.expression, reportCannotInvokePossiblyNullOrUndefinedError);
|
||||||
if (funcType === silentNeverType) {
|
if (funcType === silentNeverType) {
|
||||||
|
|
@ -54842,7 +54877,7 @@ var ts;
|
||||||
error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
|
error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, isOptional);
|
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
|
||||||
}
|
}
|
||||||
function isGenericFunctionReturningFunction(signature) {
|
function isGenericFunctionReturningFunction(signature) {
|
||||||
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
||||||
|
|
@ -54905,7 +54940,7 @@ var ts;
|
||||||
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, constructSignatures, candidatesOutArray, checkMode, /*isOptional*/ false);
|
return resolveCall(node, constructSignatures, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
}
|
}
|
||||||
// If expressionType's apparent type is an object type with no construct signatures but
|
// If expressionType's apparent type is an object type with no construct signatures but
|
||||||
// one or more call signatures, the expression is processed as a function call. A compile-time
|
// one or more call signatures, the expression is processed as a function call. A compile-time
|
||||||
|
|
@ -54913,7 +54948,7 @@ var ts;
|
||||||
// operation is Any. It is an error to have a Void this type.
|
// operation is Any. It is an error to have a Void this type.
|
||||||
var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */);
|
var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */);
|
||||||
if (callSignatures.length) {
|
if (callSignatures.length) {
|
||||||
var signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, /*isOptional*/ false);
|
var signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
if (!noImplicitAny) {
|
if (!noImplicitAny) {
|
||||||
if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) {
|
if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) {
|
||||||
error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);
|
error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);
|
||||||
|
|
@ -55090,7 +55125,7 @@ var ts;
|
||||||
invocationError(node.tag, apparentType, 0 /* Call */);
|
invocationError(node.tag, apparentType, 0 /* Call */);
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, /*isOptional*/ false);
|
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression.
|
* Gets the localized diagnostic head message to use for errors when resolving a decorator as a call expression.
|
||||||
|
|
@ -55143,7 +55178,7 @@ var ts;
|
||||||
invocationErrorRecovery(apparentType, 0 /* Call */, diag);
|
invocationErrorRecovery(apparentType, 0 /* Call */, diag);
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, /*isOptional*/ false, headMessage);
|
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */, headMessage);
|
||||||
}
|
}
|
||||||
function createSignatureForJSXIntrinsic(node, result) {
|
function createSignatureForJSXIntrinsic(node, result) {
|
||||||
var namespace = getJsxNamespaceAt(node);
|
var namespace = getJsxNamespaceAt(node);
|
||||||
|
|
@ -55181,7 +55216,7 @@ var ts;
|
||||||
error(node.tagName, ts.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts.getTextOfNode(node.tagName));
|
error(node.tagName, ts.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts.getTextOfNode(node.tagName));
|
||||||
return resolveErrorCall(node);
|
return resolveErrorCall(node);
|
||||||
}
|
}
|
||||||
return resolveCall(node, signatures, candidatesOutArray, checkMode, /*isOptional*/ false);
|
return resolveCall(node, signatures, candidatesOutArray, checkMode, 0 /* None */);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Sometimes, we have a decorator that could accept zero arguments,
|
* Sometimes, we have a decorator that could accept zero arguments,
|
||||||
|
|
@ -57441,6 +57476,18 @@ var ts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
|
||||||
|
var signature = getSingleCallSignature(funcType);
|
||||||
|
if (signature && !signature.typeParameters) {
|
||||||
|
return getReturnTypeOfSignature(signature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
||||||
|
var funcType = checkExpression(expr.expression);
|
||||||
|
var nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
||||||
|
var returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
|
||||||
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Returns the type of an expression. Unlike checkExpression, this function is simply concerned
|
* Returns the type of an expression. Unlike checkExpression, this function is simply concerned
|
||||||
* with computing the type and may not fully check all contained sub-expressions for errors.
|
* with computing the type and may not fully check all contained sub-expressions for errors.
|
||||||
|
|
@ -57452,21 +57499,10 @@ var ts;
|
||||||
// Optimize for the common case of a call to a function with a single non-generic call
|
// Optimize for the common case of a call to a function with a single non-generic call
|
||||||
// signature where we can just fetch the return type without checking the arguments.
|
// signature where we can just fetch the return type without checking the arguments.
|
||||||
if (ts.isCallExpression(expr) && expr.expression.kind !== 101 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) {
|
if (ts.isCallExpression(expr) && expr.expression.kind !== 101 /* SuperKeyword */ && !ts.isRequireCall(expr, /*checkArgumentIsStringLiteralLike*/ true) && !isSymbolOrSymbolForCall(expr)) {
|
||||||
var isOptional = void 0;
|
var type = ts.isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
||||||
var funcType = void 0;
|
getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
||||||
if (ts.isCallChain(expr)) {
|
if (type) {
|
||||||
funcType = checkExpression(expr.expression);
|
return type;
|
||||||
var nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
||||||
isOptional = funcType !== nonOptionalType;
|
|
||||||
funcType = checkNonNullType(nonOptionalType, expr.expression);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
isOptional = false;
|
|
||||||
funcType = checkNonNullExpression(expr.expression);
|
|
||||||
}
|
|
||||||
var signature = getSingleCallSignature(funcType);
|
|
||||||
if (signature && !signature.typeParameters) {
|
|
||||||
return propagateOptionalTypeMarker(getReturnTypeOfSignature(signature), isOptional);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ts.isAssertionExpression(expr) && !ts.isConstTypeReference(expr.type)) {
|
else if (ts.isAssertionExpression(expr) && !ts.isConstTypeReference(expr.type)) {
|
||||||
|
|
@ -65321,10 +65357,6 @@ var ts;
|
||||||
return !!(s.flags & 2 /* HasLiteralTypes */);
|
return !!(s.flags & 2 /* HasLiteralTypes */);
|
||||||
}
|
}
|
||||||
ts.signatureHasLiteralTypes = signatureHasLiteralTypes;
|
ts.signatureHasLiteralTypes = signatureHasLiteralTypes;
|
||||||
function signatureIsOptionalCall(s) {
|
|
||||||
return !!(s.flags & 4 /* IsOptionalCall */);
|
|
||||||
}
|
|
||||||
ts.signatureIsOptionalCall = signatureIsOptionalCall;
|
|
||||||
})(ts || (ts = {}));
|
})(ts || (ts = {}));
|
||||||
var ts;
|
var ts;
|
||||||
(function (ts) {
|
(function (ts) {
|
||||||
|
|
@ -73316,12 +73348,12 @@ var ts;
|
||||||
for (var _i = 0, parametersWithPropertyAssignments_1 = parametersWithPropertyAssignments; _i < parametersWithPropertyAssignments_1.length; _i++) {
|
for (var _i = 0, parametersWithPropertyAssignments_1 = parametersWithPropertyAssignments; _i < parametersWithPropertyAssignments_1.length; _i++) {
|
||||||
var parameter = parametersWithPropertyAssignments_1[_i];
|
var parameter = parametersWithPropertyAssignments_1[_i];
|
||||||
if (ts.isIdentifier(parameter.name)) {
|
if (ts.isIdentifier(parameter.name)) {
|
||||||
members.push(ts.aggregateTransformFlags(ts.createProperty(
|
members.push(ts.setOriginalNode(ts.aggregateTransformFlags(ts.createProperty(
|
||||||
/*decorators*/ undefined,
|
/*decorators*/ undefined,
|
||||||
/*modifiers*/ undefined, parameter.name,
|
/*modifiers*/ undefined, parameter.name,
|
||||||
/*questionOrExclamationToken*/ undefined,
|
/*questionOrExclamationToken*/ undefined,
|
||||||
/*type*/ undefined,
|
/*type*/ undefined,
|
||||||
/*initializer*/ undefined)));
|
/*initializer*/ undefined)), parameter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -74136,6 +74168,9 @@ var ts;
|
||||||
return !ts.nodeIsMissing(node.body);
|
return !ts.nodeIsMissing(node.body);
|
||||||
}
|
}
|
||||||
function visitPropertyDeclaration(node) {
|
function visitPropertyDeclaration(node) {
|
||||||
|
if (node.flags & 8388608 /* Ambient */) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
var updated = ts.updateProperty(node,
|
var updated = ts.updateProperty(node,
|
||||||
/*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), visitPropertyNameOfClassElement(node),
|
/*decorators*/ undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), visitPropertyNameOfClassElement(node),
|
||||||
/*questionOrExclamationToken*/ undefined,
|
/*questionOrExclamationToken*/ undefined,
|
||||||
|
|
@ -74520,7 +74555,12 @@ var ts;
|
||||||
*
|
*
|
||||||
* @param node The module declaration node.
|
* @param node The module declaration node.
|
||||||
*/
|
*/
|
||||||
function shouldEmitModuleDeclaration(node) {
|
function shouldEmitModuleDeclaration(nodeIn) {
|
||||||
|
var node = ts.getParseTreeNode(nodeIn, ts.isModuleDeclaration);
|
||||||
|
if (!node) {
|
||||||
|
// If we can't find a parse tree node, assume the node is instantiated.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return ts.isInstantiatedModule(node, !!compilerOptions.preserveConstEnums || !!compilerOptions.isolatedModules);
|
return ts.isInstantiatedModule(node, !!compilerOptions.preserveConstEnums || !!compilerOptions.isolatedModules);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
@ -75244,9 +75284,9 @@ var ts;
|
||||||
/**
|
/**
|
||||||
* Transforms ECMAScript Class Syntax.
|
* Transforms ECMAScript Class Syntax.
|
||||||
* TypeScript parameter property syntax is transformed in the TypeScript transformer.
|
* TypeScript parameter property syntax is transformed in the TypeScript transformer.
|
||||||
* For now, this transforms public field declarations using TypeScript class semantics
|
* For now, this transforms public field declarations using TypeScript class semantics,
|
||||||
* (where the declarations get elided and initializers are transformed as assignments in the constructor).
|
* where declarations are elided and initializers are transformed as assignments in the constructor.
|
||||||
* Eventually, this transform will change to the ECMAScript semantics (with Object.defineProperty).
|
* When --useDefineForClassFields is on, this transforms to ECMAScript semantics, with Object.defineProperty.
|
||||||
*/
|
*/
|
||||||
function transformClassFields(context) {
|
function transformClassFields(context) {
|
||||||
var hoistVariableDeclaration = context.hoistVariableDeclaration, endLexicalEnvironment = context.endLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment;
|
var hoistVariableDeclaration = context.hoistVariableDeclaration, endLexicalEnvironment = context.endLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment;
|
||||||
|
|
@ -75457,7 +75497,9 @@ var ts;
|
||||||
/*modifiers*/ undefined, parameters, body), constructor || node), constructor));
|
/*modifiers*/ undefined, parameters, body), constructor || node), constructor));
|
||||||
}
|
}
|
||||||
function transformConstructorBody(node, constructor, isDerivedClass) {
|
function transformConstructorBody(node, constructor, isDerivedClass) {
|
||||||
var properties = ts.getProperties(node, /*requireInitializer*/ !context.getCompilerOptions().useDefineForClassFields, /*isStatic*/ false);
|
var _a;
|
||||||
|
var useDefineForClassFields = context.getCompilerOptions().useDefineForClassFields;
|
||||||
|
var properties = ts.getProperties(node, /*requireInitializer*/ !useDefineForClassFields, /*isStatic*/ false);
|
||||||
// Only generate synthetic constructor when there are property initializers to move.
|
// Only generate synthetic constructor when there are property initializers to move.
|
||||||
if (!constructor && !ts.some(properties)) {
|
if (!constructor && !ts.some(properties)) {
|
||||||
return ts.visitFunctionBody(/*node*/ undefined, visitor, context);
|
return ts.visitFunctionBody(/*node*/ undefined, visitor, context);
|
||||||
|
|
@ -75486,19 +75528,16 @@ var ts;
|
||||||
// this.x = 1;
|
// this.x = 1;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
if (constructor && constructor.body) {
|
if ((_a = constructor) === null || _a === void 0 ? void 0 : _a.body) {
|
||||||
var parameterPropertyDeclarationCount = 0;
|
var afterParameterProperties = ts.findIndex(constructor.body.statements, function (s) { return !ts.isParameterPropertyDeclaration(ts.getOriginalNode(s), constructor); }, indexOfFirstStatement);
|
||||||
for (var i = indexOfFirstStatement; i < constructor.body.statements.length; i++) {
|
if (afterParameterProperties === -1) {
|
||||||
if (ts.isParameterPropertyDeclaration(ts.getOriginalNode(constructor.body.statements[i]), constructor)) {
|
afterParameterProperties = constructor.body.statements.length;
|
||||||
parameterPropertyDeclarationCount++;
|
|
||||||
}
|
}
|
||||||
else {
|
if (afterParameterProperties > indexOfFirstStatement) {
|
||||||
break;
|
if (!useDefineForClassFields) {
|
||||||
|
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement, afterParameterProperties - indexOfFirstStatement));
|
||||||
}
|
}
|
||||||
}
|
indexOfFirstStatement = afterParameterProperties;
|
||||||
if (parameterPropertyDeclarationCount > 0) {
|
|
||||||
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement, parameterPropertyDeclarationCount));
|
|
||||||
indexOfFirstStatement += parameterPropertyDeclarationCount;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addPropertyStatements(statements, properties, ts.createThis());
|
addPropertyStatements(statements, properties, ts.createThis());
|
||||||
|
|
@ -75559,7 +75598,9 @@ var ts;
|
||||||
var propertyName = ts.isComputedPropertyName(property.name) && !ts.isSimpleInlineableExpression(property.name.expression)
|
var propertyName = ts.isComputedPropertyName(property.name) && !ts.isSimpleInlineableExpression(property.name.expression)
|
||||||
? ts.updateComputedPropertyName(property.name, ts.getGeneratedNameForNode(property.name))
|
? ts.updateComputedPropertyName(property.name, ts.getGeneratedNameForNode(property.name))
|
||||||
: property.name;
|
: property.name;
|
||||||
var initializer = property.initializer || emitAssignment ? ts.visitNode(property.initializer, visitor, ts.isExpression) : ts.createVoidZero();
|
var initializer = property.initializer || emitAssignment ? ts.visitNode(property.initializer, visitor, ts.isExpression)
|
||||||
|
: ts.hasModifier(ts.getOriginalNode(property), 92 /* ParameterPropertyModifier */) && ts.isIdentifier(propertyName) ? propertyName
|
||||||
|
: ts.createVoidZero();
|
||||||
if (emitAssignment) {
|
if (emitAssignment) {
|
||||||
var memberAccess = ts.createMemberAccessForPropertyName(receiver, propertyName, /*location*/ propertyName);
|
var memberAccess = ts.createMemberAccessForPropertyName(receiver, propertyName, /*location*/ propertyName);
|
||||||
return ts.createAssignment(memberAccess, initializer);
|
return ts.createAssignment(memberAccess, initializer);
|
||||||
|
|
@ -88786,7 +88827,7 @@ var ts;
|
||||||
*/
|
*/
|
||||||
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
|
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) {
|
||||||
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
|
if (forceDtsEmit === void 0) { forceDtsEmit = false; }
|
||||||
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
|
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit);
|
||||||
var options = host.getCompilerOptions();
|
var options = host.getCompilerOptions();
|
||||||
if (options.outFile || options.out) {
|
if (options.outFile || options.out) {
|
||||||
var prepends = host.getPrependNodes();
|
var prepends = host.getPrependNodes();
|
||||||
|
|
@ -89030,7 +89071,7 @@ var ts;
|
||||||
var exportedModulesFromDeclarationEmit;
|
var exportedModulesFromDeclarationEmit;
|
||||||
// Emit each output file
|
// Emit each output file
|
||||||
enter();
|
enter();
|
||||||
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
|
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
|
||||||
exit();
|
exit();
|
||||||
return {
|
return {
|
||||||
emitSkipped: emitSkipped,
|
emitSkipped: emitSkipped,
|
||||||
|
|
@ -89418,6 +89459,7 @@ var ts;
|
||||||
getLibFileFromReference: ts.notImplemented,
|
getLibFileFromReference: ts.notImplemented,
|
||||||
isSourceFileFromExternalLibrary: ts.returnFalse,
|
isSourceFileFromExternalLibrary: ts.returnFalse,
|
||||||
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
|
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
|
||||||
|
isSourceOfProjectReferenceRedirect: ts.returnFalse,
|
||||||
writeFile: function (name, text, writeByteOrderMark) {
|
writeFile: function (name, text, writeByteOrderMark) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case jsFilePath:
|
case jsFilePath:
|
||||||
|
|
@ -94534,14 +94576,9 @@ var ts;
|
||||||
function toPath(fileName) {
|
function toPath(fileName) {
|
||||||
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
|
return ts.toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||||
}
|
}
|
||||||
function isValidSourceFileForEmit(file) {
|
|
||||||
// source file is allowed to be emitted and its not source of project reference redirect
|
|
||||||
return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) &&
|
|
||||||
!isSourceOfProjectReferenceRedirect(file.fileName);
|
|
||||||
}
|
|
||||||
function getCommonSourceDirectory() {
|
function getCommonSourceDirectory() {
|
||||||
if (commonSourceDirectory === undefined) {
|
if (commonSourceDirectory === undefined) {
|
||||||
var emittedFiles = ts.filter(files, function (file) { return isValidSourceFileForEmit(file); });
|
var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, program); });
|
||||||
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
|
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
|
||||||
// If a rootDir is specified use it as the commonSourceDirectory
|
// If a rootDir is specified use it as the commonSourceDirectory
|
||||||
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
|
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
|
||||||
|
|
@ -94944,6 +94981,7 @@ var ts;
|
||||||
return __assign(__assign({ getPrependNodes: getPrependNodes,
|
return __assign(__assign({ getPrependNodes: getPrependNodes,
|
||||||
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
|
getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
|
||||||
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
|
getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect,
|
||||||
|
isSourceOfProjectReferenceRedirect: isSourceOfProjectReferenceRedirect,
|
||||||
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
|
getProbableSymlinks: getProbableSymlinks, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
|
||||||
// Use local caches
|
// Use local caches
|
||||||
var path = toPath(f);
|
var path = toPath(f);
|
||||||
|
|
@ -96164,7 +96202,7 @@ var ts;
|
||||||
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
|
for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
|
||||||
var file = files_3[_i];
|
var file = files_3[_i];
|
||||||
// Ignore file that is not emitted
|
// Ignore file that is not emitted
|
||||||
if (isValidSourceFileForEmit(file) && !rootPaths.has(file.path)) {
|
if (ts.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
|
||||||
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
|
addProgramDiagnosticAtRefPath(file, rootPaths, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -96187,7 +96225,7 @@ var ts;
|
||||||
var typeOfSubst = typeof subst;
|
var typeOfSubst = typeof subst;
|
||||||
if (typeOfSubst === "string") {
|
if (typeOfSubst === "string") {
|
||||||
if (!ts.hasZeroOrOneAsteriskCharacter(subst)) {
|
if (!ts.hasZeroOrOneAsteriskCharacter(subst)) {
|
||||||
createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character, subst, key);
|
createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -104184,10 +104222,11 @@ var ts;
|
||||||
}
|
}
|
||||||
var dependencyKeys = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"];
|
var dependencyKeys = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"];
|
||||||
var stringContent = host.readFile(fileName);
|
var stringContent = host.readFile(fileName);
|
||||||
var content = stringContent && tryParseJson(stringContent);
|
if (!stringContent)
|
||||||
if (!content) {
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
var content = tryParseJson(stringContent);
|
||||||
|
if (!content)
|
||||||
|
return false;
|
||||||
var info = {};
|
var info = {};
|
||||||
for (var _i = 0, dependencyKeys_1 = dependencyKeys; _i < dependencyKeys_1.length; _i++) {
|
for (var _i = 0, dependencyKeys_1 = dependencyKeys; _i < dependencyKeys_1.length; _i++) {
|
||||||
var key = dependencyKeys_1[_i];
|
var key = dependencyKeys_1[_i];
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
export const typescriptVersion = "3.7.2";
|
export const typescriptVersion = "3.7.3";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue