| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dev_compiler.src.codegen.reify_coercions; | 5 library dev_compiler.src.codegen.reify_coercions; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart' as analyzer; | 7 import 'package:analyzer/analyzer.dart' as analyzer; |
| 8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
| 9 import 'package:analyzer/src/generated/element.dart'; | 9 import 'package:analyzer/src/generated/element.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 | 369 |
| 370 ///////////////// Private ////////////////////////////////// | 370 ///////////////// Private ////////////////////////////////// |
| 371 Tuple2<Identifier, Function1<Expression, Expression>> _bindExpression( | 371 Tuple2<Identifier, Function1<Expression, Expression>> _bindExpression( |
| 372 String hint, Expression e1) { | 372 String hint, Expression e1) { |
| 373 if (e1 is Identifier) { | 373 if (e1 is Identifier) { |
| 374 return new Tuple2(e1, (e2) => e2); | 374 return new Tuple2(e1, (e2) => e2); |
| 375 } | 375 } |
| 376 var id = _vm.freshIdentifier(hint); | 376 var id = _vm.freshIdentifier(hint); |
| 377 var fp = AstBuilder.simpleFormal(id, null); | 377 var fp = AstBuilder.simpleFormal(id, null); |
| 378 f(e2) => AstBuilder.parenthesize(AstBuilder.letExpression(fp, e1, e2)); | 378 Expression f(Expression e2) => |
| 379 AstBuilder.parenthesize(AstBuilder.letExpression(fp, e1, e2)); |
| 379 return new Tuple2(id, f); | 380 return new Tuple2(id, f); |
| 380 } | 381 } |
| 381 | 382 |
| 382 Expression _wrapExpression(Expression e, Wrapper w, String k, String loc) { | 383 Expression _wrapExpression(Expression e, Wrapper w, String k, String loc) { |
| 383 var q = _addWrapper(w, loc); | 384 var q = _addWrapper(w, loc); |
| 384 if (_runtime == null) { | 385 if (_runtime == null) { |
| 385 var app = AstBuilder.application(q, <Expression>[e]); | 386 var app = AstBuilder.application(q, <Expression>[e]); |
| 386 app.staticType = w.toType; | 387 app.staticType = w.toType; |
| 387 return app; | 388 return app; |
| 388 } | 389 } |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 assert(_runtime != null); | 863 assert(_runtime != null); |
| 863 if (t.typeArguments != null && t.typeArguments.length > 0) { | 864 if (t.typeArguments != null && t.typeArguments.length > 0) { |
| 864 var w = AstBuilder.identifierFromString("_"); | 865 var w = AstBuilder.identifierFromString("_"); |
| 865 var fp = AstBuilder.simpleFormal(w, t); | 866 var fp = AstBuilder.simpleFormal(w, t); |
| 866 var f = AstBuilder.blockFunction(<FormalParameter>[fp], <Statement>[]); | 867 var f = AstBuilder.blockFunction(<FormalParameter>[fp], <Statement>[]); |
| 867 return _runtime.type(f); | 868 return _runtime.type(f); |
| 868 } | 869 } |
| 869 return t.name; | 870 return t.name; |
| 870 } | 871 } |
| 871 } | 872 } |
| OLD | NEW |