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

Function getDefaultedExpandoInitializer

test/fixtures/snapshot/typescript.js:16488–16495  ·  view source on GitHub ↗

* A defaulted expando initializer matches the pattern * `Lhs = Lhs || ExpandoInitializer` * or `var Lhs = Lhs || ExpandoInitializer` * * The second Lhs is required to be the same as the first except that it may be prefixed with * 'window.', 'global.' or 'self.' The second Lh

(name, initializer, isPrototypeAssignment)

Source from the content-addressed store, hash-verified

16486 * 'window.', 'global.' or 'self.' The second Lhs is otherwise ignored by the binder and checker.
16487 */
16488 function getDefaultedExpandoInitializer(name, initializer, isPrototypeAssignment) {
16489 var e = ts.isBinaryExpression(initializer)
16490 && (initializer.operatorToken.kind === 56 /* SyntaxKind.BarBarToken */ || initializer.operatorToken.kind === 60 /* SyntaxKind.QuestionQuestionToken */)
16491 && getExpandoInitializer(initializer.right, isPrototypeAssignment);
16492 if (e && isSameEntityName(name, initializer.left)) {
16493 return e;
16494 }
16495 }
16496 function isDefaultedExpandoInitializer(node) {
16497 var name = ts.isVariableDeclaration(node.parent) ? node.parent.name :
16498 ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 63 /* SyntaxKind.EqualsToken */ ? node.parent.left :

Callers 1

Calls 2

getExpandoInitializerFunction · 0.85
isSameEntityNameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…