Merge branch 'master' into es6typings

Conflicts:
	tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types
This commit is contained in:
Mohamed Hegazy
2014-12-01 16:51:10 -08:00
70 changed files with 860 additions and 69 deletions

View File

@@ -855,25 +855,6 @@ module ts {
return SyntaxKind.FirstTriviaToken <= token && token <= SyntaxKind.LastTriviaToken;
}
export function isUnterminatedTemplateEnd(node: LiteralExpression) {
Debug.assert(isTemplateLiteralKind(node.kind));
var sourceText = getSourceFileOfNode(node).text;
// If we're not at the EOF, we know we must be terminated.
if (node.end !== sourceText.length) {
return false;
}
// The literal can only be unterminated if it is a template tail or a no-sub template.
if (node.kind !== SyntaxKind.TemplateTail && node.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) {
return false;
}
// If we didn't end in a backtick, we must still be in the middle of a template.
// If we did, make sure that it's not the *initial* backtick.
return sourceText.charCodeAt(node.end - 1) !== CharacterCodes.backtick || node.text.length === 0;
}
export function isModifier(token: SyntaxKind): boolean {
switch (token) {
case SyntaxKind.PublicKeyword:
@@ -1691,6 +1672,10 @@ module ts {
var text = scanner.getTokenValue();
node.text = internName ? internIdentifier(text) : text;
if (scanner.isUnterminated()) {
node.isUnterminated = true;
}
var tokenPos = scanner.getTokenPos();
nextToken();
finishNode(node);