| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library code_generator; | 5 library code_generator; |
| 6 | 6 |
| 7 import 'glue.dart'; | 7 import 'glue.dart'; |
| 8 | 8 |
| 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; | 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; |
| 10 import '../../js/js.dart' as js; | 10 import '../../js/js.dart' as js; |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 return buildStaticHelperInvocation(createType, | 629 return buildStaticHelperInvocation(createType, |
| 630 [buildStaticHelperInvocation(typeToString, | 630 [buildStaticHelperInvocation(typeToString, |
| 631 [visitExpression(node.value)])]); | 631 [visitExpression(node.value)])]); |
| 632 } | 632 } |
| 633 | 633 |
| 634 @override | 634 @override |
| 635 js.Expression visitReadTypeVariable(tree_ir.ReadTypeVariable node) { | 635 js.Expression visitReadTypeVariable(tree_ir.ReadTypeVariable node) { |
| 636 ClassElement context = node.variable.element.enclosingClass; | 636 ClassElement context = node.variable.element.enclosingClass; |
| 637 js.Expression index = js.number(glue.getTypeVariableIndex(node.variable)); | 637 js.Expression index = js.number(glue.getTypeVariableIndex(node.variable)); |
| 638 if (glue.needsSubstitutionForTypeVariableAccess(context)) { | 638 if (glue.needsSubstitutionForTypeVariableAccess(context)) { |
| 639 js.Expression substitution = glue.getSubstitutionName(context); | 639 js.Expression typeName = glue.getRuntimeTypeName(context); |
| 640 return buildStaticHelperInvocation( | 640 return buildStaticHelperInvocation( |
| 641 glue.getTypeArgumentWithSubstitution(), | 641 glue.getRuntimeTypeArgument(), |
| 642 [visitExpression(node.target), substitution, index]); | 642 [visitExpression(node.target), typeName, index]); |
| 643 } else { | 643 } else { |
| 644 return buildStaticHelperInvocation( | 644 return buildStaticHelperInvocation( |
| 645 glue.getTypeArgumentByIndex(), | 645 glue.getTypeArgumentByIndex(), |
| 646 [visitExpression(node.target), index]); | 646 [visitExpression(node.target), index]); |
| 647 } | 647 } |
| 648 } | 648 } |
| 649 | 649 |
| 650 @override | 650 @override |
| 651 js.Expression visitTypeExpression(tree_ir.TypeExpression node) { | 651 js.Expression visitTypeExpression(tree_ir.TypeExpression node) { |
| 652 List<js.Expression> arguments = | 652 List<js.Expression> arguments = |
| (...skipping 20 matching lines...) Expand all Loading... |
| 673 | 673 |
| 674 @override | 674 @override |
| 675 visitVariableDeclaration(tree_ir.VariableDeclaration node) { | 675 visitVariableDeclaration(tree_ir.VariableDeclaration node) { |
| 676 return errorUnsupportedNode(node); | 676 return errorUnsupportedNode(node); |
| 677 } | 677 } |
| 678 | 678 |
| 679 errorUnsupportedNode(tree_ir.DartSpecificNode node) { | 679 errorUnsupportedNode(tree_ir.DartSpecificNode node) { |
| 680 throw "Unsupported node in JS backend: $node"; | 680 throw "Unsupported node in JS backend: $node"; |
| 681 } | 681 } |
| 682 } | 682 } |
| OLD | NEW |