Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit df3a74b

Browse filesBrowse files
committed
Removed some unnecessary changes and added comments
1 parent 9c413f7 commit df3a74b
Copy full SHA for df3a74b

3 files changed

+10-11Lines changed: 10 additions & 11 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/emitter.ts‎

Copy file name to clipboardExpand all lines: src/compiler/emitter.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2832,6 +2832,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
28322832
else {
28332833
write("var ");
28342834
}
2835+
// Note here we specifically dont emit end so that if we are going to emit binding pattern
2836+
// we can alter the source map correctly
28352837
return true;
28362838
}
28372839

@@ -3732,7 +3734,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
37323734
const isVariableDeclarationOrBindingElement =
37333735
name.parent && (name.parent.kind === SyntaxKind.VariableDeclaration || name.parent.kind === SyntaxKind.BindingElement);
37343736

3735-
// If this is first var declaration, we need to stary at var/let/const keyword instead
3737+
// If this is first var declaration, we need to start at var/let/const keyword instead
37363738
// otherwise use nodeForSourceMap as the start position
37373739
emitStart(isFirstVariableDeclaration(nodeForSourceMap) ? nodeForSourceMap.parent : nodeForSourceMap);
37383740
withTemporaryNoSourceMap(() => {
Collapse file

‎src/compiler/sourcemap.ts‎

Copy file name to clipboardExpand all lines: src/compiler/sourcemap.ts
+6-9Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,20 +232,17 @@ namespace ts {
232232
sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan);
233233
}
234234

235-
function getSourceLinePos(pos: number) {
236-
const sourceLinePos = getLineAndCharacterOfPosition(currentSourceFile, pos);
237-
// Convert the location to be one-based.
238-
sourceLinePos.line++;
239-
sourceLinePos.character++;
240-
return sourceLinePos;
241-
}
242-
243235
function emitPos(pos: number) {
244236
if (pos === -1) {
245237
return;
246238
}
247239

248-
const sourceLinePos = getSourceLinePos(pos);
240+
const sourceLinePos = getLineAndCharacterOfPosition(currentSourceFile, pos);
241+
242+
// Convert the location to be one-based.
243+
sourceLinePos.line++;
244+
sourceLinePos.character++;
245+
249246
const emittedLine = writer.getLine();
250247
const emittedColumn = writer.getColumn();
251248

Collapse file

‎src/compiler/utilities.ts‎

Copy file name to clipboardExpand all lines: src/compiler/utilities.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ namespace ts {
16161616
return node.kind === SyntaxKind.QualifiedName;
16171617
}
16181618

1619-
export function nodeIsSynthesized(node: Node | TextRange): boolean {
1619+
export function nodeIsSynthesized(node: Node): boolean {
16201620
return node.pos === -1;
16211621
}
16221622

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.