Removed some unnecessary changes and added comments

This commit is contained in:
Sheetal Nandi 2015-12-10 15:35:47 -08:00
parent 9c413f7d55
commit df3a74b6ca
3 changed files with 10 additions and 11 deletions

View File

@ -2832,6 +2832,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
else {
write("var ");
}
// Note here we specifically dont emit end so that if we are going to emit binding pattern
// we can alter the source map correctly
return true;
}
@ -3732,7 +3734,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
const isVariableDeclarationOrBindingElement =
name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement);
// If this is first var declaration, we need to stary at var/let/const keyword instead
// If this is first var declaration, we need to start at var/let/const keyword instead
// otherwise use nodeForSourceMap as the start position
emitStart(isFirstVariableDeclaration(nodeForSourceMap) ? nodeForSourceMap.parent : nodeForSourceMap);
withTemporaryNoSourceMap(() => {

View File

@ -232,20 +232,17 @@ namespace ts {
sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan);
}
function getSourceLinePos(pos: number) {
const sourceLinePos = getLineAndCharacterOfPosition(currentSourceFile, pos);
// Convert the location to be one-based.
sourceLinePos.line++;
sourceLinePos.character++;
return sourceLinePos;
}
function emitPos(pos: number) {
if (pos === -1) {
return;
}
const sourceLinePos = getSourceLinePos(pos);
const sourceLinePos = getLineAndCharacterOfPosition(currentSourceFile, pos);
// Convert the location to be one-based.
sourceLinePos.line++;
sourceLinePos.character++;
const emittedLine = writer.getLine();
const emittedColumn = writer.getColumn();

View File

@ -1616,7 +1616,7 @@ namespace ts {
return node.kind === SyntaxKind.QualifiedName;
}
export function nodeIsSynthesized(node: Node | TextRange): boolean {
export function nodeIsSynthesized(node: Node): boolean {
return node.pos === -1;
}