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

Function createArrayLiteralExpression

test/fixtures/snapshot/typescript.js:23981–23992  ·  view source on GitHub ↗
(elements, multiLine)

Source from the content-addressed store, hash-verified

23979 }
23980 // @api
23981 function createArrayLiteralExpression(elements, multiLine) {
23982 var node = createBaseExpression(204 /* SyntaxKind.ArrayLiteralExpression */);
23983 // Ensure we add a trailing comma for something like `[NumericLiteral(1), NumericLiteral(2), OmittedExpresion]` so that
23984 // we end up with `[1, 2, ,]` instead of `[1, 2, ]` otherwise the `OmittedExpression` will just end up being treated like
23985 // a trailing comma.
23986 var lastElement = elements && ts.lastOrUndefined(elements);
23987 var elementsArray = createNodeArray(elements, lastElement && ts.isOmittedExpression(lastElement) ? true : undefined);
23988 node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
23989 node.multiLine = multiLine;
23990 node.transformFlags |= propagateChildrenFlags(node.elements);
23991 return node;
23992 }
23993 // @api
23994 function updateArrayLiteralExpression(node, elements) {
23995 return node.elements !== elements

Callers 1

Calls 3

createBaseExpressionFunction · 0.85
createNodeArrayFunction · 0.85
propagateChildrenFlagsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…