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

Function reduceElement

test/fixtures/snapshot/typescript.js:102592–102606  ·  view source on GitHub ↗
(expressions, element)

Source from the content-addressed store, hash-verified

102590 ? factory.createArrayConcatCall(temp, [factory.createArrayLiteralExpression(expressions, multiLine)])
102591 : ts.setTextRange(factory.createArrayLiteralExpression(leadingElement ? __spreadArray([leadingElement], expressions, true) : expressions, multiLine), location);
102592 function reduceElement(expressions, element) {
102593 if (containsYield(element) && expressions.length > 0) {
102594 var hasAssignedTemp = temp !== undefined;
102595 if (!temp) {
102596 temp = declareLocal();
102597 }
102598 emitAssignment(temp, hasAssignedTemp
102599 ? factory.createArrayConcatCall(temp, [factory.createArrayLiteralExpression(expressions, multiLine)])
102600 : factory.createArrayLiteralExpression(leadingElement ? __spreadArray([leadingElement], expressions, true) : expressions, multiLine));
102601 leadingElement = undefined;
102602 expressions = [];
102603 }
102604 expressions.push(ts.visitNode(element, visitor, ts.isExpression));
102605 return expressions;
102606 }
102607 }
102608 function visitObjectLiteralExpression(node) {
102609 // [source]

Callers

nothing calls this directly

Calls 4

declareLocalFunction · 0.85
emitAssignmentFunction · 0.85
containsYieldFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…