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

Function getVariableDeclarationOfObjectLiteral

test/fixtures/snapshot/typescript.js:51660–51670  ·  view source on GitHub ↗
(symbol, meaning)

Source from the content-addressed store, hash-verified

51658 }
51659 }
51660 function getVariableDeclarationOfObjectLiteral(symbol, meaning) {
51661 // If we're trying to reference some object literal in, eg `var a = { x: 1 }`, the symbol for the literal, `__object`, is distinct
51662 // from the symbol of the declaration it is being assigned to. Since we can use the declaration to refer to the literal, however,
51663 // we'd like to make that connection here - potentially causing us to paint the declaration's visibility, and therefore the literal.
51664 var firstDecl = !!ts.length(symbol.declarations) && ts.first(symbol.declarations);
51665 if (meaning & 111551 /* SymbolFlags.Value */ && firstDecl && firstDecl.parent && ts.isVariableDeclaration(firstDecl.parent)) {
51666 if (ts.isObjectLiteralExpression(firstDecl) && firstDecl === firstDecl.parent.initializer || ts.isTypeLiteralNode(firstDecl) && firstDecl === firstDecl.parent.type) {
51667 return getSymbolOfNode(firstDecl.parent);
51668 }
51669 }
51670 }
51671 function getFileSymbolIfFileSymbolExportEqualsContainer(d, container) {
51672 var fileSymbol = getExternalModuleContainer(d);
51673 var exported = fileSymbol && fileSymbol.exports && fileSymbol.exports.get("export=" /* InternalSymbolName.ExportEquals */);

Callers 1

getContainersOfSymbolFunction · 0.85

Calls 3

getSymbolOfNodeFunction · 0.85
lengthMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…