* Visits a right-associative binary expression containing `yield`. * * @param node The node to visit.
(node)
| 102319 | * @param node The node to visit. |
| 102320 | */ |
| 102321 | function visitRightAssociativeBinaryExpression(node) { |
| 102322 | var left = node.left, right = node.right; |
| 102323 | if (containsYield(right)) { |
| 102324 | var target = void 0; |
| 102325 | switch (left.kind) { |
| 102326 | case 206 /* SyntaxKind.PropertyAccessExpression */: |
| 102327 | // [source] |
| 102328 | // a.b = yield; |
| 102329 | // |
| 102330 | // [intermediate] |
| 102331 | // .local _a |
| 102332 | // _a = a; |
| 102333 | // .yield resumeLabel |
| 102334 | // .mark resumeLabel |
| 102335 | // _a.b = %sent%; |
| 102336 | target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); |
| 102337 | break; |
| 102338 | case 207 /* SyntaxKind.ElementAccessExpression */: |
| 102339 | // [source] |
| 102340 | // a[b] = yield; |
| 102341 | // |
| 102342 | // [intermediate] |
| 102343 | // .local _a, _b |
| 102344 | // _a = a; |
| 102345 | // _b = b; |
| 102346 | // .yield resumeLabel |
| 102347 | // .mark resumeLabel |
| 102348 | // _a[_b] = %sent%; |
| 102349 | target = factory.updateElementAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); |
| 102350 | break; |
| 102351 | default: |
| 102352 | target = ts.visitNode(left, visitor, ts.isExpression); |
| 102353 | break; |
| 102354 | } |
| 102355 | var operator = node.operatorToken.kind; |
| 102356 | if (ts.isCompoundAssignment(operator)) { |
| 102357 | return ts.setTextRange(factory.createAssignment(target, ts.setTextRange(factory.createBinaryExpression(cacheExpression(target), ts.getNonAssignmentOperatorForCompoundAssignment(operator), ts.visitNode(right, visitor, ts.isExpression)), node)), node); |
| 102358 | } |
| 102359 | else { |
| 102360 | return factory.updateBinaryExpression(node, target, node.operatorToken, ts.visitNode(right, visitor, ts.isExpression)); |
| 102361 | } |
| 102362 | } |
| 102363 | return ts.visitEachChild(node, visitor, context); |
| 102364 | } |
| 102365 | function visitLeftAssociativeBinaryExpression(node) { |
| 102366 | if (containsYield(node.right)) { |
| 102367 | if (ts.isLogicalOperator(node.operatorToken.kind)) { |
no test coverage detected
searching dependent graphs…