mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG
This commit is contained in:
+215
-224
@@ -10551,6 +10551,14 @@ var ts;
|
||||
}
|
||||
}
|
||||
ts.getThisContainer = getThisContainer;
|
||||
function isInTopLevelContext(node) {
|
||||
if (ts.isIdentifier(node) && (ts.isClassDeclaration(node.parent) || ts.isFunctionDeclaration(node.parent)) && node.parent.name === node) {
|
||||
node = node.parent;
|
||||
}
|
||||
var container = getThisContainer(node, true);
|
||||
return ts.isSourceFile(container);
|
||||
}
|
||||
ts.isInTopLevelContext = isInTopLevelContext;
|
||||
function getNewTargetContainer(node) {
|
||||
var container = getThisContainer(node, false);
|
||||
if (container) {
|
||||
@@ -11639,13 +11647,7 @@ var ts;
|
||||
case 198:
|
||||
return parent.name === node;
|
||||
case 156:
|
||||
if (parent.right === node) {
|
||||
while (parent.kind === 156) {
|
||||
parent = parent.parent;
|
||||
}
|
||||
return parent.kind === 175 || parent.kind === 172;
|
||||
}
|
||||
return false;
|
||||
return parent.right === node;
|
||||
case 195:
|
||||
case 262:
|
||||
return parent.propertyName === node;
|
||||
@@ -22057,31 +22059,6 @@ var ts;
|
||||
createBaseNode: function (kind) { return countNode(new NodeConstructor(kind, 0, 0)); }
|
||||
};
|
||||
var factory = ts.createNodeFactory(1 | 2 | 8, baseNodeFactory);
|
||||
var reparseContext = {
|
||||
get factory() { return factory; },
|
||||
enableEmitNotification: ts.notImplemented,
|
||||
enableSubstitution: ts.notImplemented,
|
||||
endLexicalEnvironment: ts.returnUndefined,
|
||||
getCompilerOptions: ts.notImplemented,
|
||||
getEmitHost: ts.notImplemented,
|
||||
getEmitResolver: ts.notImplemented,
|
||||
getEmitHelperFactory: ts.notImplemented,
|
||||
setLexicalEnvironmentFlags: ts.noop,
|
||||
getLexicalEnvironmentFlags: function () { return 0; },
|
||||
hoistFunctionDeclaration: ts.notImplemented,
|
||||
hoistVariableDeclaration: ts.notImplemented,
|
||||
addInitializationStatement: ts.notImplemented,
|
||||
isEmitNotificationEnabled: ts.notImplemented,
|
||||
isSubstitutionEnabled: ts.notImplemented,
|
||||
onEmitNode: ts.notImplemented,
|
||||
onSubstituteNode: ts.notImplemented,
|
||||
readEmitHelpers: ts.notImplemented,
|
||||
requestEmitHelper: ts.notImplemented,
|
||||
resumeLexicalEnvironment: ts.noop,
|
||||
startLexicalEnvironment: ts.noop,
|
||||
suspendLexicalEnvironment: ts.noop,
|
||||
addDiagnostic: ts.notImplemented,
|
||||
};
|
||||
var fileName;
|
||||
var sourceFlags;
|
||||
var sourceText;
|
||||
@@ -22099,6 +22076,7 @@ var ts;
|
||||
var parsingContext;
|
||||
var notParenthesizedArrow;
|
||||
var contextFlags;
|
||||
var topLevel = true;
|
||||
var parseErrorBeforeNextFinishedNode = false;
|
||||
function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
|
||||
if (setParentNodes === void 0) { setParentNodes = false; }
|
||||
@@ -22210,6 +22188,7 @@ var ts;
|
||||
identifierCount = 0;
|
||||
nodeCount = 0;
|
||||
sourceFlags = 0;
|
||||
topLevel = true;
|
||||
switch (scriptKind) {
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -22243,6 +22222,7 @@ var ts;
|
||||
parsingContext = 0;
|
||||
identifiers = undefined;
|
||||
notParenthesizedArrow = undefined;
|
||||
topLevel = true;
|
||||
}
|
||||
function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind) {
|
||||
var isDeclarationFile = isDeclarationFileName(fileName);
|
||||
@@ -22289,106 +22269,90 @@ var ts;
|
||||
return node;
|
||||
}
|
||||
function reparseTopLevelAwait(sourceFile) {
|
||||
return ts.visitEachChild(sourceFile, visitor, reparseContext);
|
||||
function visitor(node) {
|
||||
if (!(node.transformFlags & 8388608)) {
|
||||
return node;
|
||||
var savedSyntaxCursor = syntaxCursor;
|
||||
var baseSyntaxCursor = IncrementalParser.createSyntaxCursor(sourceFile);
|
||||
syntaxCursor = { currentNode: currentNode };
|
||||
var statements = [];
|
||||
var savedParseDiagnostics = parseDiagnostics;
|
||||
parseDiagnostics = [];
|
||||
var pos = 0;
|
||||
var start = findNextStatementWithAwait(sourceFile.statements, 0);
|
||||
var _loop_3 = function () {
|
||||
var prevStatement = sourceFile.statements[pos];
|
||||
var nextStatement = sourceFile.statements[start];
|
||||
ts.addRange(statements, sourceFile.statements, pos, start);
|
||||
pos = findNextStatementWithoutAwait(sourceFile.statements, start);
|
||||
var diagnosticStart = ts.findIndex(savedParseDiagnostics, function (diagnostic) { return diagnostic.start >= prevStatement.pos; });
|
||||
var diagnosticEnd = diagnosticStart >= 0 ? ts.findIndex(savedParseDiagnostics, function (diagnostic) { return diagnostic.start >= nextStatement.pos; }, diagnosticStart) : -1;
|
||||
if (diagnosticStart >= 0) {
|
||||
ts.addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart, diagnosticEnd >= 0 ? diagnosticEnd : undefined);
|
||||
}
|
||||
switch (node.kind) {
|
||||
case 160: return reparseDecorator(node);
|
||||
case 157: return reparseComputedPropertyName(node);
|
||||
case 220: return reparseExpressionWithTypeArguments(node);
|
||||
case 230: return reparseExpressionStatement(node);
|
||||
case 231: return reparseIfStatement(node);
|
||||
case 241: return reparseSwitchStatement(node);
|
||||
case 240: return reparseWithStatement(node);
|
||||
case 232: return reparseDoStatement(node);
|
||||
case 233: return reparseWhileStatement(node);
|
||||
case 234: return reparseForStatement(node);
|
||||
case 235: return reparseForInStatement(node);
|
||||
case 236: return reparseForOfStatement(node);
|
||||
case 239: return reparseReturnStatement(node);
|
||||
case 243: return reparseThrowStatement(node);
|
||||
case 263: return reparseExportAssignment(node);
|
||||
case 246: return reparseVariableDeclaration(node);
|
||||
case 195: return reparseBindingElement(node);
|
||||
default: return ts.visitEachChild(node, visitor, reparseContext);
|
||||
speculationHelper(function () {
|
||||
var savedContextFlags = contextFlags;
|
||||
contextFlags |= 32768;
|
||||
scanner.setTextPos(nextStatement.pos);
|
||||
nextToken();
|
||||
while (token() !== 1) {
|
||||
var startPos = scanner.getStartPos();
|
||||
var statement = parseListElement(0, parseStatement);
|
||||
statements.push(statement);
|
||||
if (startPos === scanner.getStartPos()) {
|
||||
nextToken();
|
||||
}
|
||||
if (pos >= 0) {
|
||||
var nonAwaitStatement = sourceFile.statements[pos];
|
||||
if (statement.end === nonAwaitStatement.pos) {
|
||||
break;
|
||||
}
|
||||
if (statement.end > nonAwaitStatement.pos) {
|
||||
pos = findNextStatementWithoutAwait(sourceFile.statements, pos + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
contextFlags = savedContextFlags;
|
||||
}, 2);
|
||||
start = pos >= 0 ? findNextStatementWithAwait(sourceFile.statements, pos) : -1;
|
||||
};
|
||||
while (start !== -1) {
|
||||
_loop_3();
|
||||
}
|
||||
if (pos >= 0) {
|
||||
var prevStatement_1 = sourceFile.statements[pos];
|
||||
ts.addRange(statements, sourceFile.statements, pos);
|
||||
var diagnosticStart = ts.findIndex(savedParseDiagnostics, function (diagnostic) { return diagnostic.start >= prevStatement_1.pos; });
|
||||
if (diagnosticStart >= 0) {
|
||||
ts.addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart);
|
||||
}
|
||||
}
|
||||
function reparse(node, parse) {
|
||||
if (node && node.transformFlags & 8388608) {
|
||||
if (ts.isExpression(node)) {
|
||||
return speculationHelper(function () {
|
||||
scanner.setTextPos(node.pos);
|
||||
var savedContextFlags = contextFlags;
|
||||
contextFlags = node.flags & 25358336;
|
||||
nextToken();
|
||||
var result = doInAwaitContext(parse);
|
||||
contextFlags = savedContextFlags;
|
||||
return result;
|
||||
}, 2);
|
||||
syntaxCursor = savedSyntaxCursor;
|
||||
return factory.updateSourceFile(sourceFile, ts.setTextRange(factory.createNodeArray(statements), sourceFile.statements));
|
||||
function containsPossibleTopLevelAwait(node) {
|
||||
return !(node.flags & 32768)
|
||||
&& !!(node.transformFlags & 8388608);
|
||||
}
|
||||
function findNextStatementWithAwait(statements, start) {
|
||||
for (var i = start; i < statements.length; i++) {
|
||||
if (containsPossibleTopLevelAwait(statements[i])) {
|
||||
return i;
|
||||
}
|
||||
return ts.visitEachChild(node, visitor, reparseContext);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
function findNextStatementWithoutAwait(statements, start) {
|
||||
for (var i = start; i < statements.length; i++) {
|
||||
if (!containsPossibleTopLevelAwait(statements[i])) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
function currentNode(position) {
|
||||
var node = baseSyntaxCursor.currentNode(position);
|
||||
if (topLevel && node && containsPossibleTopLevelAwait(node)) {
|
||||
node.intersectsChange = true;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
function update(updated, original) {
|
||||
if (updated !== original) {
|
||||
ts.setNodeFlags(updated, updated.flags | 32768);
|
||||
}
|
||||
return updated;
|
||||
}
|
||||
function reparseExpressionStatement(node) {
|
||||
return update(factory.updateExpressionStatement(node, reparse(node.expression, parseExpression)), node);
|
||||
}
|
||||
function reparseReturnStatement(node) {
|
||||
return update(factory.updateReturnStatement(node, reparse(node.expression, parseExpression)), node);
|
||||
}
|
||||
function reparseThrowStatement(node) {
|
||||
return update(factory.updateThrowStatement(node, reparse(node.expression, parseExpression)), node);
|
||||
}
|
||||
function reparseIfStatement(node) {
|
||||
return update(factory.updateIfStatement(node, reparse(node.expression, parseExpression), ts.visitNode(node.thenStatement, visitor), ts.visitNode(node.elseStatement, visitor)), node);
|
||||
}
|
||||
function reparseSwitchStatement(node) {
|
||||
return update(factory.updateSwitchStatement(node, reparse(node.expression, parseExpression), ts.visitNode(node.caseBlock, visitor)), node);
|
||||
}
|
||||
function reparseWithStatement(node) {
|
||||
return update(factory.updateWithStatement(node, reparse(node.expression, parseExpression), ts.visitNode(node.statement, visitor)), node);
|
||||
}
|
||||
function reparseDoStatement(node) {
|
||||
return update(factory.updateDoStatement(node, ts.visitNode(node.statement, visitor), reparse(node.expression, parseExpression)), node);
|
||||
}
|
||||
function reparseWhileStatement(node) {
|
||||
return update(factory.updateWhileStatement(node, reparse(node.expression, parseExpression), ts.visitNode(node.statement, visitor)), node);
|
||||
}
|
||||
function reparseForStatement(node) {
|
||||
return update(factory.updateForStatement(node, reparse(node.initializer, parseExpression), reparse(node.condition, parseExpression), reparse(node.incrementor, parseExpression), ts.visitNode(node, visitor)), node);
|
||||
}
|
||||
function reparseForInStatement(node) {
|
||||
return update(factory.updateForInStatement(node, reparse(node.initializer, parseExpression), reparse(node.expression, parseExpression), ts.visitNode(node.statement, visitor)), node);
|
||||
}
|
||||
function reparseForOfStatement(node) {
|
||||
return update(factory.updateForOfStatement(node, node.awaitModifier, reparse(node.initializer, parseExpression), reparse(node.expression, parseExpression), ts.visitNode(node.statement, visitor)), node);
|
||||
}
|
||||
function reparseExportAssignment(node) {
|
||||
return update(factory.updateExportAssignment(node, ts.visitNodes(node.decorators, visitor), node.modifiers, reparse(node.expression, parseExpression)), node);
|
||||
}
|
||||
function reparseExpressionWithTypeArguments(node) {
|
||||
return update(factory.updateExpressionWithTypeArguments(node, reparse(node.expression, parseLeftHandSideExpressionOrHigher), node.typeArguments), node);
|
||||
}
|
||||
function reparseDecorator(node) {
|
||||
return update(factory.updateDecorator(node, reparse(node.expression, parseLeftHandSideExpressionOrHigher)), node);
|
||||
}
|
||||
function reparseComputedPropertyName(node) {
|
||||
return update(factory.updateComputedPropertyName(node, reparse(node.expression, parseExpression)), node);
|
||||
}
|
||||
function reparseVariableDeclaration(node) {
|
||||
return update(factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor), node.exclamationToken, node.type, reparse(node.initializer, parseExpression)), node);
|
||||
}
|
||||
function reparseBindingElement(node) {
|
||||
return update(factory.updateBindingElement(node, node.dotDotDotToken, ts.visitNode(node.propertyName, visitor), ts.visitNode(node.name, visitor), reparse(node.initializer, parseExpression)), node);
|
||||
}
|
||||
}
|
||||
function fixupParentReferences(rootNode) {
|
||||
ts.setParentRecursive(rootNode, true);
|
||||
@@ -22582,6 +22546,12 @@ var ts;
|
||||
function tryParse(callback) {
|
||||
return speculationHelper(callback, 0);
|
||||
}
|
||||
function isBindingIdentifier() {
|
||||
if (token() === 78) {
|
||||
return true;
|
||||
}
|
||||
return token() > 115;
|
||||
}
|
||||
function isIdentifier() {
|
||||
if (token() === 78) {
|
||||
return true;
|
||||
@@ -22734,6 +22704,9 @@ var ts;
|
||||
ts.Diagnostics.Identifier_expected;
|
||||
return createMissingNode(78, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg);
|
||||
}
|
||||
function parseBindingIdentifier(privateIdentifierDiagnosticMessage) {
|
||||
return createIdentifier(isBindingIdentifier(), undefined, privateIdentifierDiagnosticMessage);
|
||||
}
|
||||
function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) {
|
||||
return createIdentifier(isIdentifier(), diagnosticMessage, privateIdentifierDiagnosticMessage);
|
||||
}
|
||||
@@ -22886,9 +22859,9 @@ var ts;
|
||||
return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword();
|
||||
}
|
||||
case 8:
|
||||
return isIdentifierOrPrivateIdentifierOrPattern();
|
||||
return isBindingIdentifierOrPrivateIdentifierOrPattern();
|
||||
case 10:
|
||||
return token() === 27 || token() === 25 || isIdentifierOrPrivateIdentifierOrPattern();
|
||||
return token() === 27 || token() === 25 || isBindingIdentifierOrPrivateIdentifierOrPattern();
|
||||
case 19:
|
||||
return isIdentifier();
|
||||
case 15:
|
||||
@@ -23538,7 +23511,7 @@ var ts;
|
||||
}
|
||||
function isStartOfParameter(isJSDocParameter) {
|
||||
return token() === 25 ||
|
||||
isIdentifierOrPrivateIdentifierOrPattern() ||
|
||||
isBindingIdentifierOrPrivateIdentifierOrPattern() ||
|
||||
ts.isModifierKind(token()) ||
|
||||
token() === 59 ||
|
||||
isStartOfType(!isJSDocParameter);
|
||||
@@ -23550,15 +23523,26 @@ var ts;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
function parseParameterInOuterAwaitContext() {
|
||||
return parseParameterWorker(true);
|
||||
}
|
||||
function parseParameter() {
|
||||
return parseParameterWorker(false);
|
||||
}
|
||||
function parseParameterWorker(inOuterAwaitContext) {
|
||||
var pos = getNodePos();
|
||||
var hasJSDoc = hasPrecedingJSDocComment();
|
||||
if (token() === 107) {
|
||||
var node = factory.createParameterDeclaration(undefined, undefined, undefined, createIdentifier(true), undefined, parseTypeAnnotation(), undefined);
|
||||
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
||||
var node_1 = factory.createParameterDeclaration(undefined, undefined, undefined, createIdentifier(true), undefined, parseTypeAnnotation(), undefined);
|
||||
return withJSDoc(finishNode(node_1, pos), hasJSDoc);
|
||||
}
|
||||
var modifiers;
|
||||
return withJSDoc(finishNode(factory.createParameterDeclaration(parseDecorators(), modifiers = parseModifiers(), parseOptionalToken(25), parseNameOfParameter(modifiers), parseOptionalToken(57), parseTypeAnnotation(), parseInitializer()), pos), hasJSDoc);
|
||||
var decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : parseDecorators();
|
||||
var savedTopLevel = topLevel;
|
||||
topLevel = false;
|
||||
var modifiers = parseModifiers();
|
||||
var node = withJSDoc(finishNode(factory.createParameterDeclaration(decorators, modifiers, parseOptionalToken(25), parseNameOfParameter(modifiers), parseOptionalToken(57), parseTypeAnnotation(), parseInitializer()), pos), hasJSDoc);
|
||||
topLevel = savedTopLevel;
|
||||
return node;
|
||||
}
|
||||
function parseReturnType(returnToken, isType) {
|
||||
if (shouldParseReturnType(returnToken, isType)) {
|
||||
@@ -23587,7 +23571,7 @@ var ts;
|
||||
setAwaitContext(!!(flags & 2));
|
||||
var parameters = flags & 32 ?
|
||||
parseDelimitedList(17, parseJSDocParameter) :
|
||||
parseDelimitedList(16, parseParameter);
|
||||
parseDelimitedList(16, savedAwaitContext ? parseParameterInOuterAwaitContext : parseParameter);
|
||||
setYieldContext(savedYieldContext);
|
||||
setAwaitContext(savedAwaitContext);
|
||||
return parameters;
|
||||
@@ -24480,9 +24464,13 @@ var ts;
|
||||
!isStartOfExpressionStatement()) {
|
||||
return parseFunctionBlock(16 | (isAsync ? 2 : 0));
|
||||
}
|
||||
return isAsync
|
||||
var savedTopLevel = topLevel;
|
||||
topLevel = false;
|
||||
var node = isAsync
|
||||
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
||||
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
||||
topLevel = savedTopLevel;
|
||||
return node;
|
||||
}
|
||||
function parseConditionalExpressionRest(leftOperand, pos) {
|
||||
var questionToken = parseOptionalToken(57);
|
||||
@@ -25215,10 +25203,10 @@ var ts;
|
||||
var asteriskToken = parseOptionalToken(41);
|
||||
var isGenerator = asteriskToken ? 1 : 0;
|
||||
var isAsync = ts.some(modifiers, ts.isAsyncModifier) ? 2 : 0;
|
||||
var name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalIdentifier) :
|
||||
isGenerator ? doInYieldContext(parseOptionalIdentifier) :
|
||||
isAsync ? doInAwaitContext(parseOptionalIdentifier) :
|
||||
parseOptionalIdentifier();
|
||||
var name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalBindingIdentifier) :
|
||||
isGenerator ? doInYieldContext(parseOptionalBindingIdentifier) :
|
||||
isAsync ? doInAwaitContext(parseOptionalBindingIdentifier) :
|
||||
parseOptionalBindingIdentifier();
|
||||
var typeParameters = parseTypeParameters();
|
||||
var parameters = parseParameters(isGenerator | isAsync);
|
||||
var type = parseReturnType(58, false);
|
||||
@@ -25229,8 +25217,8 @@ var ts;
|
||||
var node = factory.createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body);
|
||||
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
||||
}
|
||||
function parseOptionalIdentifier() {
|
||||
return isIdentifier() ? parseIdentifier() : undefined;
|
||||
function parseOptionalBindingIdentifier() {
|
||||
return isBindingIdentifier() ? parseBindingIdentifier() : undefined;
|
||||
}
|
||||
function parseNewExpressionOrNewDotTarget() {
|
||||
var pos = getNodePos();
|
||||
@@ -25285,6 +25273,8 @@ var ts;
|
||||
setYieldContext(!!(flags & 1));
|
||||
var savedAwaitContext = inAwaitContext();
|
||||
setAwaitContext(!!(flags & 2));
|
||||
var savedTopLevel = topLevel;
|
||||
topLevel = false;
|
||||
var saveDecoratorContext = inDecoratorContext();
|
||||
if (saveDecoratorContext) {
|
||||
setDecoratorContext(false);
|
||||
@@ -25293,6 +25283,7 @@ var ts;
|
||||
if (saveDecoratorContext) {
|
||||
setDecoratorContext(true);
|
||||
}
|
||||
topLevel = savedTopLevel;
|
||||
setYieldContext(savedYieldContext);
|
||||
setAwaitContext(savedAwaitContext);
|
||||
return block;
|
||||
@@ -25791,7 +25782,7 @@ var ts;
|
||||
function parseObjectBindingElement() {
|
||||
var pos = getNodePos();
|
||||
var dotDotDotToken = parseOptionalToken(25);
|
||||
var tokenIsIdentifier = isIdentifier();
|
||||
var tokenIsIdentifier = isBindingIdentifier();
|
||||
var propertyName = parsePropertyName();
|
||||
var name;
|
||||
if (tokenIsIdentifier && token() !== 58) {
|
||||
@@ -25819,11 +25810,11 @@ var ts;
|
||||
parseExpected(23);
|
||||
return finishNode(factory.createArrayBindingPattern(elements), pos);
|
||||
}
|
||||
function isIdentifierOrPrivateIdentifierOrPattern() {
|
||||
function isBindingIdentifierOrPrivateIdentifierOrPattern() {
|
||||
return token() === 18
|
||||
|| token() === 22
|
||||
|| token() === 79
|
||||
|| isIdentifier();
|
||||
|| isBindingIdentifier();
|
||||
}
|
||||
function parseIdentifierOrPattern(privateIdentifierDiagnosticMessage) {
|
||||
if (token() === 22) {
|
||||
@@ -25832,7 +25823,7 @@ var ts;
|
||||
if (token() === 18) {
|
||||
return parseObjectBindingPattern();
|
||||
}
|
||||
return parseIdentifier(undefined, privateIdentifierDiagnosticMessage);
|
||||
return parseBindingIdentifier(privateIdentifierDiagnosticMessage);
|
||||
}
|
||||
function parseVariableDeclarationAllowExclamation() {
|
||||
return parseVariableDeclaration(true);
|
||||
@@ -25893,7 +25884,7 @@ var ts;
|
||||
var modifierFlags = ts.modifiersToFlags(modifiers);
|
||||
parseExpected(97);
|
||||
var asteriskToken = parseOptionalToken(41);
|
||||
var name = modifierFlags & 512 ? parseOptionalIdentifier() : parseIdentifier();
|
||||
var name = modifierFlags & 512 ? parseOptionalBindingIdentifier() : parseBindingIdentifier();
|
||||
var isGenerator = asteriskToken ? 1 : 0;
|
||||
var isAsync = modifierFlags & 256 ? 2 : 0;
|
||||
var typeParameters = parseTypeParameters();
|
||||
@@ -26013,12 +26004,22 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function parseDecoratorExpression() {
|
||||
if (inAwaitContext() && token() === 130) {
|
||||
var pos = getNodePos();
|
||||
var awaitExpression = parseIdentifier(ts.Diagnostics.Expression_expected);
|
||||
nextToken();
|
||||
var memberExpression = parseMemberExpressionRest(pos, awaitExpression, true);
|
||||
return parseCallExpressionRest(pos, memberExpression);
|
||||
}
|
||||
return parseLeftHandSideExpressionOrHigher();
|
||||
}
|
||||
function tryParseDecorator() {
|
||||
var pos = getNodePos();
|
||||
if (!parseOptional(59)) {
|
||||
return undefined;
|
||||
}
|
||||
var expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher);
|
||||
var expression = doInDecoratorContext(parseDecoratorExpression);
|
||||
return finishNode(factory.createDecorator(expression), pos);
|
||||
}
|
||||
function parseDecorators() {
|
||||
@@ -26138,8 +26139,8 @@ var ts;
|
||||
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
||||
}
|
||||
function parseNameOfClassDeclarationOrExpression() {
|
||||
return isIdentifier() && !isImplementsClause()
|
||||
? parseIdentifier()
|
||||
return isBindingIdentifier() && !isImplementsClause()
|
||||
? createIdentifier(isBindingIdentifier())
|
||||
: undefined;
|
||||
}
|
||||
function isImplementsClause() {
|
||||
@@ -27603,6 +27604,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
IncrementalParser.createSyntaxCursor = createSyntaxCursor;
|
||||
})(IncrementalParser || (IncrementalParser = {}));
|
||||
function isDeclarationFileName(fileName) {
|
||||
return ts.fileExtensionIs(fileName, ".d.ts");
|
||||
@@ -29277,7 +29279,7 @@ var ts;
|
||||
}
|
||||
function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) {
|
||||
var result = returnValue ? {} : undefined;
|
||||
var _loop_3 = function (element) {
|
||||
var _loop_4 = function (element) {
|
||||
if (element.kind !== 285) {
|
||||
errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected));
|
||||
return "continue";
|
||||
@@ -29325,7 +29327,7 @@ var ts;
|
||||
};
|
||||
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
|
||||
var element = _a[_i];
|
||||
_loop_3(element);
|
||||
_loop_4(element);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -29489,7 +29491,7 @@ var ts;
|
||||
var optionsNameMap = _a.optionsNameMap;
|
||||
var result = ts.createMap();
|
||||
var getCanonicalFileName = pathOptions && ts.createGetCanonicalFileName(pathOptions.useCaseSensitiveFileNames);
|
||||
var _loop_4 = function (name) {
|
||||
var _loop_5 = function (name) {
|
||||
if (ts.hasProperty(options, name)) {
|
||||
if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) {
|
||||
return "continue";
|
||||
@@ -29518,7 +29520,7 @@ var ts;
|
||||
}
|
||||
};
|
||||
for (var name in options) {
|
||||
_loop_4(name);
|
||||
_loop_5(name);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -30138,7 +30140,7 @@ var ts;
|
||||
}
|
||||
var jsonOnlyIncludeRegexes;
|
||||
if (validatedIncludeSpecs && validatedIncludeSpecs.length > 0) {
|
||||
var _loop_5 = function (file) {
|
||||
var _loop_6 = function (file) {
|
||||
if (ts.fileExtensionIs(file, ".json")) {
|
||||
if (!jsonOnlyIncludeRegexes) {
|
||||
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json"); });
|
||||
@@ -30165,7 +30167,7 @@ var ts;
|
||||
};
|
||||
for (var _a = 0, _b = host.readDirectory(basePath, supportedExtensionsWithJsonIfResolveJsonModule, validatedExcludeSpecs, validatedIncludeSpecs, undefined); _a < _b.length; _a++) {
|
||||
var file = _b[_a];
|
||||
_loop_5(file);
|
||||
_loop_6(file);
|
||||
}
|
||||
}
|
||||
var literalFiles = ts.arrayFrom(literalFileMap.values());
|
||||
@@ -33063,16 +33065,27 @@ var ts;
|
||||
parent = saveParent;
|
||||
currentFlow = saveCurrentFlow;
|
||||
}
|
||||
function checkStrictModeIdentifier(node) {
|
||||
if (inStrictMode &&
|
||||
node.originalKeywordKind >= 116 &&
|
||||
node.originalKeywordKind <= 124 &&
|
||||
!ts.isIdentifierName(node) &&
|
||||
function checkContextualIdentifier(node) {
|
||||
if (!file.parseDiagnostics.length &&
|
||||
!(node.flags & 8388608) &&
|
||||
!(node.flags & 4194304)) {
|
||||
if (!file.parseDiagnostics.length) {
|
||||
!(node.flags & 4194304) &&
|
||||
!ts.isIdentifierName(node)) {
|
||||
if (inStrictMode &&
|
||||
node.originalKeywordKind >= 116 &&
|
||||
node.originalKeywordKind <= 124) {
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node)));
|
||||
}
|
||||
else if (node.originalKeywordKind === 130) {
|
||||
if (ts.isExternalModule(file) && ts.isInTopLevelContext(node)) {
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, ts.declarationNameToString(node)));
|
||||
}
|
||||
else if (node.flags & 32768) {
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, ts.declarationNameToString(node)));
|
||||
}
|
||||
}
|
||||
else if (node.originalKeywordKind === 124 && node.flags & 8192) {
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, ts.declarationNameToString(node)));
|
||||
}
|
||||
}
|
||||
}
|
||||
function getStrictModeIdentifierMessage(node) {
|
||||
@@ -33278,7 +33291,7 @@ var ts;
|
||||
if (currentFlow && (ts.isExpression(node) || parent.kind === 286)) {
|
||||
node.flowNode = currentFlow;
|
||||
}
|
||||
return checkStrictModeIdentifier(node);
|
||||
return checkContextualIdentifier(node);
|
||||
case 105:
|
||||
node.flowNode = currentFlow;
|
||||
break;
|
||||
@@ -35112,7 +35125,7 @@ var ts;
|
||||
function addDuplicateDeclarationError(node, message, symbolName, relatedNodes) {
|
||||
var errorNode = (ts.getExpandoInitializer(node, false) ? ts.getNameOfExpando(node) : ts.getNameOfDeclaration(node)) || node;
|
||||
var err = lookupOrIssueError(errorNode, message, symbolName);
|
||||
var _loop_6 = function (relatedNode) {
|
||||
var _loop_7 = function (relatedNode) {
|
||||
var adjustedNode = (ts.getExpandoInitializer(relatedNode, false) ? ts.getNameOfExpando(relatedNode) : ts.getNameOfDeclaration(relatedNode)) || relatedNode;
|
||||
if (adjustedNode === errorNode)
|
||||
return "continue";
|
||||
@@ -35125,7 +35138,7 @@ var ts;
|
||||
};
|
||||
for (var _i = 0, _a = relatedNodes || ts.emptyArray; _i < _a.length; _i++) {
|
||||
var relatedNode = _a[_i];
|
||||
_loop_6(relatedNode);
|
||||
_loop_7(relatedNode);
|
||||
}
|
||||
}
|
||||
function combineSymbolTables(first, second) {
|
||||
@@ -37026,7 +37039,7 @@ var ts;
|
||||
}
|
||||
function forEachSymbolTableInScope(enclosingDeclaration, callback) {
|
||||
var result;
|
||||
var _loop_7 = function (location) {
|
||||
var _loop_8 = function (location) {
|
||||
if (location.locals && !isGlobalSourceFile(location)) {
|
||||
if (result = callback(location.locals)) {
|
||||
return { value: result };
|
||||
@@ -37059,7 +37072,7 @@ var ts;
|
||||
}
|
||||
};
|
||||
for (var location = enclosingDeclaration; location; location = location.parent) {
|
||||
var state_2 = _loop_7(location);
|
||||
var state_2 = _loop_8(location);
|
||||
if (typeof state_2 === "object")
|
||||
return state_2.value;
|
||||
}
|
||||
@@ -38886,7 +38899,7 @@ var ts;
|
||||
if (ts.length(reexports) > 1) {
|
||||
var groups = ts.group(reexports, function (decl) { return ts.isStringLiteral(decl.moduleSpecifier) ? ">" + decl.moduleSpecifier.text : ">"; });
|
||||
if (groups.length !== reexports.length) {
|
||||
var _loop_8 = function (group_1) {
|
||||
var _loop_9 = function (group_1) {
|
||||
if (group_1.length > 1) {
|
||||
statements = __spreadArrays(ts.filter(statements, function (s) { return group_1.indexOf(s) === -1; }), [
|
||||
ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports(ts.flatMap(group_1, function (e) { return ts.cast(e.exportClause, ts.isNamedExports).elements; })), group_1[0].moduleSpecifier)
|
||||
@@ -38895,7 +38908,7 @@ var ts;
|
||||
};
|
||||
for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {
|
||||
var group_1 = groups_1[_i];
|
||||
_loop_8(group_1);
|
||||
_loop_9(group_1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41829,7 +41842,7 @@ var ts;
|
||||
if (!ts.length(result) && indexWithLengthOverOne !== -1) {
|
||||
var masterList = signatureLists[indexWithLengthOverOne !== undefined ? indexWithLengthOverOne : 0];
|
||||
var results = masterList.slice();
|
||||
var _loop_9 = function (signatures) {
|
||||
var _loop_10 = function (signatures) {
|
||||
if (signatures !== masterList) {
|
||||
var signature_1 = signatures[0];
|
||||
ts.Debug.assert(!!signature_1, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass");
|
||||
@@ -41841,7 +41854,7 @@ var ts;
|
||||
};
|
||||
for (var _b = 0, signatureLists_1 = signatureLists; _b < signatureLists_1.length; _b++) {
|
||||
var signatures = signatureLists_1[_b];
|
||||
var state_3 = _loop_9(signatures);
|
||||
var state_3 = _loop_10(signatures);
|
||||
if (state_3 === "break")
|
||||
break;
|
||||
}
|
||||
@@ -41956,7 +41969,7 @@ var ts;
|
||||
var types = type.types;
|
||||
var mixinFlags = findMixins(types);
|
||||
var mixinCount = ts.countWhere(mixinFlags, function (b) { return b; });
|
||||
var _loop_10 = function (i) {
|
||||
var _loop_11 = function (i) {
|
||||
var t = type.types[i];
|
||||
if (!mixinFlags[i]) {
|
||||
var signatures = getSignaturesOfType(t, 1);
|
||||
@@ -41974,19 +41987,19 @@ var ts;
|
||||
numberIndexInfo = intersectIndexInfos(numberIndexInfo, getIndexInfoOfType(t, 1));
|
||||
};
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
_loop_10(i);
|
||||
_loop_11(i);
|
||||
}
|
||||
setStructuredTypeMembers(type, emptySymbols, callSignatures || ts.emptyArray, constructSignatures || ts.emptyArray, stringIndexInfo, numberIndexInfo);
|
||||
}
|
||||
function appendSignatures(signatures, newSignatures) {
|
||||
var _loop_11 = function (sig) {
|
||||
var _loop_12 = function (sig) {
|
||||
if (!signatures || ts.every(signatures, function (s) { return !compareSignaturesIdentical(s, sig, false, false, false, compareTypesIdentical); })) {
|
||||
signatures = ts.append(signatures, sig);
|
||||
}
|
||||
};
|
||||
for (var _i = 0, newSignatures_1 = newSignatures; _i < newSignatures_1.length; _i++) {
|
||||
var sig = newSignatures_1[_i];
|
||||
_loop_11(sig);
|
||||
_loop_12(sig);
|
||||
}
|
||||
return signatures;
|
||||
}
|
||||
@@ -44032,7 +44045,7 @@ var ts;
|
||||
var expandedDeclarations = [];
|
||||
var optionalIndex = -1;
|
||||
var restTypes;
|
||||
var _loop_12 = function (i) {
|
||||
var _loop_13 = function (i) {
|
||||
var type = elementTypes[i];
|
||||
var flags = target.elementFlags[i];
|
||||
if (flags & 8) {
|
||||
@@ -44051,7 +44064,7 @@ var ts;
|
||||
}
|
||||
};
|
||||
for (var i = 0; i < elementTypes.length; i++) {
|
||||
_loop_12(i);
|
||||
_loop_13(i);
|
||||
}
|
||||
if (restTypes) {
|
||||
expandedTypes[expandedTypes.length - 1] = getUnionType(restTypes);
|
||||
@@ -44976,7 +44989,7 @@ var ts;
|
||||
function getConditionalType(root, mapper) {
|
||||
var result;
|
||||
var extraTypes;
|
||||
var _loop_13 = function () {
|
||||
var _loop_14 = function () {
|
||||
var checkType = instantiateType(root.checkType, mapper);
|
||||
var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType);
|
||||
var extendsType = instantiateType(root.extendsType, mapper);
|
||||
@@ -45025,7 +45038,7 @@ var ts;
|
||||
return "break";
|
||||
};
|
||||
while (true) {
|
||||
var state_4 = _loop_13();
|
||||
var state_4 = _loop_14();
|
||||
if (typeof state_4 === "object")
|
||||
return state_4.value;
|
||||
if (state_4 === "break")
|
||||
@@ -47216,7 +47229,7 @@ var ts;
|
||||
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
||||
checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
|
||||
}
|
||||
var _loop_14 = function (prop) {
|
||||
var _loop_15 = function (prop) {
|
||||
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
||||
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
||||
if (reportErrors) {
|
||||
@@ -47269,7 +47282,7 @@ var ts;
|
||||
};
|
||||
for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
|
||||
var prop = _a[_i];
|
||||
var state_5 = _loop_14(prop);
|
||||
var state_5 = _loop_15(prop);
|
||||
if (typeof state_5 === "object")
|
||||
return state_5.value;
|
||||
}
|
||||
@@ -47821,11 +47834,11 @@ var ts;
|
||||
}
|
||||
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
||||
var matchingTypes = [];
|
||||
var _loop_15 = function (combination) {
|
||||
var _loop_16 = function (combination) {
|
||||
var hasMatch = false;
|
||||
outer: for (var _i = 0, _a = target.types; _i < _a.length; _i++) {
|
||||
var type = _a[_i];
|
||||
var _loop_16 = function (i) {
|
||||
var _loop_17 = function (i) {
|
||||
var sourceProperty = sourcePropertiesFiltered[i];
|
||||
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
||||
if (!targetProperty)
|
||||
@@ -47838,7 +47851,7 @@ var ts;
|
||||
}
|
||||
};
|
||||
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
||||
var state_7 = _loop_16(i);
|
||||
var state_7 = _loop_17(i);
|
||||
switch (state_7) {
|
||||
case "continue-outer": continue outer;
|
||||
}
|
||||
@@ -47852,7 +47865,7 @@ var ts;
|
||||
};
|
||||
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
||||
var combination = discriminantCombinations_1[_a];
|
||||
var state_6 = _loop_15(combination);
|
||||
var state_6 = _loop_16(combination);
|
||||
if (typeof state_6 === "object")
|
||||
return state_6.value;
|
||||
}
|
||||
@@ -48433,7 +48446,7 @@ var ts;
|
||||
if (!variances) {
|
||||
cache.variances = ts.emptyArray;
|
||||
variances = [];
|
||||
var _loop_17 = function (tp) {
|
||||
var _loop_18 = function (tp) {
|
||||
var unmeasurable = false;
|
||||
var unreliable = false;
|
||||
var oldHandler = outofbandVarianceMarkerHandler;
|
||||
@@ -48458,7 +48471,7 @@ var ts;
|
||||
};
|
||||
for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
|
||||
var tp = typeParameters_1[_i];
|
||||
_loop_17(tp);
|
||||
_loop_18(tp);
|
||||
}
|
||||
cache.variances = variances;
|
||||
}
|
||||
@@ -54858,7 +54871,7 @@ var ts;
|
||||
var spreadIndex = getSpreadArgumentIndex(args);
|
||||
if (spreadIndex >= 0) {
|
||||
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
||||
var _loop_18 = function (i) {
|
||||
var _loop_19 = function (i) {
|
||||
var arg = args[i];
|
||||
var spreadType = arg.kind === 217 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
||||
if (spreadType && isTupleType(spreadType)) {
|
||||
@@ -54874,7 +54887,7 @@ var ts;
|
||||
}
|
||||
};
|
||||
for (var i = spreadIndex; i < args.length; i++) {
|
||||
_loop_18(i);
|
||||
_loop_19(i);
|
||||
}
|
||||
return effectiveArgs_1;
|
||||
}
|
||||
@@ -55109,7 +55122,7 @@ var ts;
|
||||
var min_3 = Number.MAX_VALUE;
|
||||
var minIndex = 0;
|
||||
var i_1 = 0;
|
||||
var _loop_19 = function (c) {
|
||||
var _loop_20 = function (c) {
|
||||
var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
||||
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
|
||||
if (diags_2) {
|
||||
@@ -55127,7 +55140,7 @@ var ts;
|
||||
};
|
||||
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
||||
var c = candidatesForArgumentError_1[_a];
|
||||
_loop_19(c);
|
||||
_loop_20(c);
|
||||
}
|
||||
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
||||
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
||||
@@ -55248,7 +55261,7 @@ var ts;
|
||||
}
|
||||
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
||||
var parameters = [];
|
||||
var _loop_20 = function (i) {
|
||||
var _loop_21 = function (i) {
|
||||
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
||||
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
||||
i < s.parameters.length ? s.parameters[i] : undefined; });
|
||||
@@ -55256,7 +55269,7 @@ var ts;
|
||||
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
||||
};
|
||||
for (var i = 0; i < maxNonRestParam; i++) {
|
||||
_loop_20(i);
|
||||
_loop_21(i);
|
||||
}
|
||||
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
||||
var flags = 0;
|
||||
@@ -56765,14 +56778,10 @@ var ts;
|
||||
checkExpression(node.expression);
|
||||
return undefinedWideningType;
|
||||
}
|
||||
function isInTopLevelContext(node) {
|
||||
var container = ts.getThisContainer(node, true);
|
||||
return ts.isSourceFile(container);
|
||||
}
|
||||
function checkAwaitExpression(node) {
|
||||
if (produceDiagnostics) {
|
||||
if (!(node.flags & 32768)) {
|
||||
if (isInTopLevelContext(node)) {
|
||||
if (ts.isInTopLevelContext(node)) {
|
||||
var sourceFile = ts.getSourceFileOfNode(node);
|
||||
if (!hasParseDiagnostics(sourceFile)) {
|
||||
var span = void 0;
|
||||
@@ -61108,7 +61117,7 @@ var ts;
|
||||
}
|
||||
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
||||
var issuedMemberError = false;
|
||||
var _loop_21 = function (member) {
|
||||
var _loop_22 = function (member) {
|
||||
if (ts.hasStaticModifier(member)) {
|
||||
return "continue";
|
||||
}
|
||||
@@ -61126,7 +61135,7 @@ var ts;
|
||||
};
|
||||
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
||||
var member = _a[_i];
|
||||
_loop_21(member);
|
||||
_loop_22(member);
|
||||
}
|
||||
if (!issuedMemberError) {
|
||||
checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
|
||||
@@ -61811,7 +61820,6 @@ var ts;
|
||||
}
|
||||
}
|
||||
function checkImportBinding(node) {
|
||||
checkGrammarAwaitIdentifier(node.name);
|
||||
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
|
||||
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
|
||||
checkAliasSymbol(node);
|
||||
@@ -62864,10 +62872,10 @@ var ts;
|
||||
return checkDestructuringAssignment(expr, iteratedType || errorType);
|
||||
}
|
||||
if (expr.parent.kind === 285) {
|
||||
var node_1 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression);
|
||||
var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_1) || errorType;
|
||||
var propertyIndex = ts.indexOfNode(node_1.properties, expr.parent);
|
||||
return checkObjectLiteralDestructuringPropertyAssignment(node_1, typeOfParentObjectLiteral, propertyIndex);
|
||||
var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression);
|
||||
var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType;
|
||||
var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent);
|
||||
return checkObjectLiteralDestructuringPropertyAssignment(node_2, typeOfParentObjectLiteral, propertyIndex);
|
||||
}
|
||||
var node = ts.cast(expr.parent, ts.isArrayLiteralExpression);
|
||||
var typeOfArrayLiteral = getTypeOfAssignmentPattern(node) || errorType;
|
||||
@@ -64097,28 +64105,17 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function checkGrammarAwaitIdentifier(name) {
|
||||
if (name && ts.isIdentifier(name) && name.originalKeywordKind === 130 && isInTopLevelContext(name.parent)) {
|
||||
var file = ts.getSourceFileOfNode(name);
|
||||
if (!file.isDeclarationFile && ts.isExternalModule(file)) {
|
||||
return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, ts.idText(name));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function checkGrammarFunctionLikeDeclaration(node) {
|
||||
var file = ts.getSourceFileOfNode(node);
|
||||
return checkGrammarDecoratorsAndModifiers(node) ||
|
||||
checkGrammarTypeParameterList(node.typeParameters, file) ||
|
||||
(ts.isFunctionDeclaration(node) && checkGrammarAwaitIdentifier(node.name)) ||
|
||||
checkGrammarParameterList(node.parameters) ||
|
||||
checkGrammarArrowFunction(node, file) ||
|
||||
(ts.isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node));
|
||||
}
|
||||
function checkGrammarClassLikeDeclaration(node) {
|
||||
var file = ts.getSourceFileOfNode(node);
|
||||
return (ts.isClassDeclaration(node) && checkGrammarAwaitIdentifier(node.name)) ||
|
||||
checkGrammarClassDeclarationHeritageClauses(node) ||
|
||||
return checkGrammarClassDeclarationHeritageClauses(node) ||
|
||||
checkGrammarTypeParameterList(node.typeParameters, file);
|
||||
}
|
||||
function checkGrammarArrowFunction(node, file) {
|
||||
@@ -64645,9 +64642,6 @@ var ts;
|
||||
return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_have_a_property_name);
|
||||
}
|
||||
}
|
||||
if (ts.isIdentifier(node.name) && checkGrammarAwaitIdentifier(node.name)) {
|
||||
return true;
|
||||
}
|
||||
if (node.dotDotDotToken && node.initializer) {
|
||||
return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);
|
||||
}
|
||||
@@ -64703,9 +64697,6 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ts.isIdentifier(node.name) && checkGrammarAwaitIdentifier(node.name)) {
|
||||
return true;
|
||||
}
|
||||
if (node.exclamationToken && (node.parent.parent.kind !== 229 || !node.type || node.initializer || node.flags & 8388608)) {
|
||||
return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation);
|
||||
}
|
||||
@@ -87967,7 +87958,7 @@ var ts;
|
||||
importedFileFromNodeModules = importedFileFromNodeModules || ts.pathContainsNodeModules(path);
|
||||
});
|
||||
var sortedPaths = [];
|
||||
var _loop_22 = function (directory) {
|
||||
var _loop_23 = function (directory) {
|
||||
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
||||
var pathsInDirectory;
|
||||
allFileNames.forEach(function (canonicalFileName, fileName) {
|
||||
@@ -87992,7 +87983,7 @@ var ts;
|
||||
};
|
||||
var out_directory_1;
|
||||
for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) {
|
||||
var state_8 = _loop_22(directory);
|
||||
var state_8 = _loop_23(directory);
|
||||
directory = out_directory_1;
|
||||
if (state_8 === "break")
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user