Adds source maps for captured this, skips source map for synthetic return token in arrow.

This commit is contained in:
Ron Buckton 2016-04-20 18:36:05 -07:00
parent 6b1f8525d9
commit 719705faf6
2 changed files with 7 additions and 4 deletions

View File

@ -1546,7 +1546,7 @@ const _super = (function (geti, seti) {
const savedTempFlags = tempFlags;
tempFlags = 0;
emitSignatureHead(node);
emitBlockFunctionBodyAndEndLexicalEnvironment(node, body);
emitBlockFunctionBody(node, body);
if (indentedFlag) {
decreaseIndent();
}
@ -1610,7 +1610,7 @@ const _super = (function (geti, seti) {
return true;
}
function emitBlockFunctionBodyAndEndLexicalEnvironment(parentNode: Node, body: Block) {
function emitBlockFunctionBody(parentNode: Node, body: Block) {
// TODO(rbuckton): This should be removed once source maps are aligned with the old
// emitter and new baselines are taken. This exists solely to
// align with the old emitter.

View File

@ -1063,7 +1063,8 @@ namespace ts {
"_this",
createThis()
)
])
]),
/*location*/ node
)
);
}
@ -1343,7 +1344,9 @@ namespace ts {
const expression = visitNode(body, visitor, isExpression);
if (expression) {
statements.push(createReturn(expression, /*location*/ statementsLocation));
const returnStatement = createReturn(expression, /*location*/ statementsLocation);
setNodeEmitFlags(returnStatement, NodeEmitFlags.NoTokenSourceMaps);
statements.push(returnStatement);
}
}