This commit is contained in:
Cyrus Najmabadi
2015-03-13 13:40:23 -07:00
8 changed files with 113 additions and 3 deletions
+1 -1
View File
@@ -11072,7 +11072,7 @@ module ts {
var symbol = declarationSymbol ||
getNodeLinks(n).resolvedSymbol ||
resolveName(n, n.text, SymbolFlags.BlockScopedVariable | SymbolFlags.Alias, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
resolveName(n, n.text, SymbolFlags.Value | SymbolFlags.Alias, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
var isLetOrConst =
symbol &&
+8 -2
View File
@@ -2975,6 +2975,12 @@ module ts {
return !scanner.hasPrecedingLineBreak() && isIdentifier()
}
function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() {
nextToken();
return !scanner.hasPrecedingLineBreak() &&
(isIdentifier() || token === SyntaxKind.OpenBraceToken || token === SyntaxKind.OpenBracketToken);
}
function parseYieldExpression(): YieldExpression {
var node = <YieldExpression>createNode(SyntaxKind.YieldExpression);
@@ -4873,9 +4879,9 @@ module ts {
}
function isLetDeclaration() {
// It is let declaration if in strict mode or next token is identifier on same line.
// It is let declaration if in strict mode or next token is identifier\open bracket\open curly on same line.
// otherwise it needs to be treated like identifier
return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOnSameLine);
return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine);
}
function isDeclarationStart(): boolean {