MCPcopy Index your code
hub / github.com/nodejs/node / transformAndEmitTryStatement

Function transformAndEmitTryStatement

test/fixtures/snapshot/typescript.js:103287–103333  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

103285 /*location*/ node);
103286 }
103287 function transformAndEmitTryStatement(node) {
103288 if (containsYield(node)) {
103289 // [source]
103290 // try {
103291 // /*tryBlock*/
103292 // }
103293 // catch (e) {
103294 // /*catchBlock*/
103295 // }
103296 // finally {
103297 // /*finallyBlock*/
103298 // }
103299 //
103300 // [intermediate]
103301 // .local _a
103302 // .try tryLabel, catchLabel, finallyLabel, endLabel
103303 // .mark tryLabel
103304 // .nop
103305 // /*tryBlock*/
103306 // .br endLabel
103307 // .catch
103308 // .mark catchLabel
103309 // _a = %error%;
103310 // /*catchBlock*/
103311 // .br endLabel
103312 // .finally
103313 // .mark finallyLabel
103314 // /*finallyBlock*/
103315 // .endfinally
103316 // .endtry
103317 // .mark endLabel
103318 beginExceptionBlock();
103319 transformAndEmitEmbeddedStatement(node.tryBlock);
103320 if (node.catchClause) {
103321 beginCatchBlock(node.catchClause.variableDeclaration); // TODO: GH#18217
103322 transformAndEmitEmbeddedStatement(node.catchClause.block);
103323 }
103324 if (node.finallyBlock) {
103325 beginFinallyBlock();
103326 transformAndEmitEmbeddedStatement(node.finallyBlock);
103327 }
103328 endExceptionBlock();
103329 }
103330 else {
103331 emitStatement(ts.visitEachChild(node, visitor, context));
103332 }
103333 }
103334 function containsYield(node) {
103335 return !!node && (node.transformFlags & 524288 /* TransformFlags.ContainsYield */) !== 0;
103336 }

Callers 1

Calls 7

beginExceptionBlockFunction · 0.85
beginCatchBlockFunction · 0.85
beginFinallyBlockFunction · 0.85
endExceptionBlockFunction · 0.85
emitStatementFunction · 0.85
containsYieldFunction · 0.70

Tested by

no test coverage detected