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

Function visitCommaExpression

test/fixtures/snapshot/typescript.js:102390–102416  ·  view source on GitHub ↗

* Visits a comma expression containing `yield`. * * @param node The node to visit.

(node)

Source from the content-addressed store, hash-verified

102388 * @param node The node to visit.
102389 */
102390 function visitCommaExpression(node) {
102391 // [source]
102392 // x = a(), yield, b();
102393 //
102394 // [intermediate]
102395 // a();
102396 // .yield resumeLabel
102397 // .mark resumeLabel
102398 // x = %sent%, b();
102399 var pendingExpressions = [];
102400 visit(node.left);
102401 visit(node.right);
102402 return factory.inlineExpressions(pendingExpressions);
102403 function visit(node) {
102404 if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* SyntaxKind.CommaToken */) {
102405 visit(node.left);
102406 visit(node.right);
102407 }
102408 else {
102409 if (containsYield(node) && pendingExpressions.length > 0) {
102410 emitWorker(1 /* OpCode.Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]);
102411 pendingExpressions = [];
102412 }
102413 pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression));
102414 }
102415 }
102416 }
102417 /**
102418 * Visits a comma-list expression.
102419 *

Callers 2

visitCommaListExpressionFunction · 0.85

Calls 1

visitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…