MCPcopy Create free account
hub / github.com/nodejs/node / elaborateArrayLiteral

Function elaborateArrayLiteral

test/fixtures/snapshot/typescript.js:64248–64269  ·  view source on GitHub ↗
(node, source, target, relation, containingMessageChain, errorOutputContainer)

Source from the content-addressed store, hash-verified

64246 });
64247 }
64248 function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) {
64249 if (target.flags & 131068 /* TypeFlags.Primitive */)
64250 return false;
64251 if (isTupleLikeType(source)) {
64252 return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer);
64253 }
64254 // recreate a tuple from the elements, if possible
64255 // Since we're re-doing the expression type, we need to reapply the contextual type
64256 var oldContext = node.contextualType;
64257 node.contextualType = target;
64258 try {
64259 var tupleizedType = checkArrayLiteral(node, 1 /* CheckMode.Contextual */, /*forceTuple*/ true);
64260 node.contextualType = oldContext;
64261 if (isTupleLikeType(tupleizedType)) {
64262 return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, containingMessageChain, errorOutputContainer);
64263 }
64264 return false;
64265 }
64266 finally {
64267 node.contextualType = oldContext;
64268 }
64269 }
64270 function generateObjectLiteralElements(node) {
64271 var _i, _a, prop, type, _b;
64272 return __generator(this, function (_c) {

Callers 1

elaborateErrorFunction · 0.85

Calls 4

isTupleLikeTypeFunction · 0.85
elaborateElementwiseFunction · 0.85
checkArrayLiteralFunction · 0.85

Tested by

no test coverage detected