* 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)
| 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 : |
no test coverage detected
searching dependent graphs…