mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Removed some unnecessary changes and added comments
This commit is contained in:
parent
9c413f7d55
commit
df3a74b6ca
@ -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(() => {
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user