mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Adds source maps for captured this, skips source map for synthetic return token in arrow.
This commit is contained in:
parent
6b1f8525d9
commit
719705faf6
@ -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.
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user