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

Function getJSContainerObjectType

test/fixtures/snapshot/typescript.js:56231–56251  ·  view source on GitHub ↗
(decl, symbol, init)

Source from the content-addressed store, hash-verified

56229 return widened;
56230 }
56231 function getJSContainerObjectType(decl, symbol, init) {
56232 var _a, _b;
56233 if (!ts.isInJSFile(decl) || !init || !ts.isObjectLiteralExpression(init) || init.properties.length) {
56234 return undefined;
56235 }
56236 var exports = ts.createSymbolTable();
56237 while (ts.isBinaryExpression(decl) || ts.isPropertyAccessExpression(decl)) {
56238 var s_2 = getSymbolOfNode(decl);
56239 if ((_a = s_2 === null || s_2 === void 0 ? void 0 : s_2.exports) === null || _a === void 0 ? void 0 : _a.size) {
56240 mergeSymbolTable(exports, s_2.exports);
56241 }
56242 decl = ts.isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
56243 }
56244 var s = getSymbolOfNode(decl);
56245 if ((_b = s === null || s === void 0 ? void 0 : s.exports) === null || _b === void 0 ? void 0 : _b.size) {
56246 mergeSymbolTable(exports, s.exports);
56247 }
56248 var type = createAnonymousType(symbol, exports, ts.emptyArray, ts.emptyArray, ts.emptyArray);
56249 type.objectFlags |= 4096 /* ObjectFlags.JSLiteral */;
56250 return type;
56251 }
56252 function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
56253 var _a;
56254 var typeNode = ts.getEffectiveTypeAnnotationNode(expression.parent);

Calls 3

getSymbolOfNodeFunction · 0.85
mergeSymbolTableFunction · 0.85
createAnonymousTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…