| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.builder_accessors; | 5 library fasta.builder_accessors; |
| 6 | 6 |
| 7 export 'frontend_accessors.dart' show | 7 export 'frontend_accessors.dart' show |
| 8 wrapInvalid; | 8 wrapInvalid; |
| 9 | 9 |
| 10 import 'frontend_accessors.dart' show | 10 import 'frontend_accessors.dart' show |
| 11 Accessor; | 11 Accessor; |
| 12 | 12 |
| 13 import 'package:kernel/ast.dart'; | 13 import 'package:kernel/ast.dart'; |
| 14 | 14 |
| 15 import 'package:kernel/core_types.dart' show | 15 import 'package:kernel/core_types.dart' show |
| 16 CoreTypes; | 16 CoreTypes; |
| 17 | 17 |
| 18 import '../errors.dart' show | 18 import '../errors.dart' show |
| 19 InputError, | 19 internalError, |
| 20 internalError; | 20 printUnexpected; |
| 21 | 21 |
| 22 import 'frontend_accessors.dart' as kernel show | 22 import 'frontend_accessors.dart' as kernel show |
| 23 IndexAccessor, | 23 IndexAccessor, |
| 24 NullAwarePropertyAccessor, | 24 NullAwarePropertyAccessor, |
| 25 PropertyAccessor, | 25 PropertyAccessor, |
| 26 StaticAccessor, | 26 StaticAccessor, |
| 27 SuperIndexAccessor, | 27 SuperIndexAccessor, |
| 28 SuperPropertyAccessor, | 28 SuperPropertyAccessor, |
| 29 ThisIndexAccessor, | 29 ThisIndexAccessor, |
| 30 ThisPropertyAccessor, | 30 ThisPropertyAccessor, |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 return buildMethodInvocation(buildSimpleRead(), new Name("call"), arguments, | 711 return buildMethodInvocation(buildSimpleRead(), new Name("call"), arguments, |
| 712 charOffset); | 712 charOffset); |
| 713 } | 713 } |
| 714 | 714 |
| 715 toString() => "VariableAccessor()"; | 715 toString() => "VariableAccessor()"; |
| 716 } | 716 } |
| 717 | 717 |
| 718 Expression throwNoSuchMethodError(String name, Arguments arguments, Uri uri, | 718 Expression throwNoSuchMethodError(String name, Arguments arguments, Uri uri, |
| 719 int charOffset, CoreTypes coreTypes, | 719 int charOffset, CoreTypes coreTypes, |
| 720 {bool isSuper: false, isGetter: false, isSetter: false}) { | 720 {bool isSuper: false, isGetter: false, isSetter: false}) { |
| 721 print(new InputError(uri, charOffset, "Method not found: '$name'.").format()); | 721 printUnexpected(uri, charOffset, "Method not found: '$name'."); |
| 722 Constructor constructor = coreTypes.getCoreClass( | 722 Constructor constructor = coreTypes.getCoreClass( |
| 723 "dart:core", "NoSuchMethodError").constructors.first; | 723 "dart:core", "NoSuchMethodError").constructors.first; |
| 724 return new Throw(new ConstructorInvocation( | 724 return new Throw(new ConstructorInvocation( |
| 725 constructor, | 725 constructor, |
| 726 new Arguments(<Expression>[ | 726 new Arguments(<Expression>[ |
| 727 new NullLiteral(), | 727 new NullLiteral(), |
| 728 new SymbolLiteral(name), | 728 new SymbolLiteral(name), |
| 729 new ListLiteral(arguments.positional), | 729 new ListLiteral(arguments.positional), |
| 730 new MapLiteral(arguments.named.map((arg) { | 730 new MapLiteral(arguments.named.map((arg) { |
| 731 return new MapEntry(new SymbolLiteral(arg.name), arg.value); | 731 return new MapEntry(new SymbolLiteral(arg.name), arg.value); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 747 buildIsNull(new VariableGet(variable)), | 747 buildIsNull(new VariableGet(variable)), |
| 748 new NullLiteral(), | 748 new NullLiteral(), |
| 749 new MethodInvocation(new VariableGet(variable), name, arguments) | 749 new MethodInvocation(new VariableGet(variable), name, arguments) |
| 750 ..fileOffset = charOffset, | 750 ..fileOffset = charOffset, |
| 751 const DynamicType())); | 751 const DynamicType())); |
| 752 } else { | 752 } else { |
| 753 return new MethodInvocation(receiver, name, arguments) | 753 return new MethodInvocation(receiver, name, arguments) |
| 754 ..fileOffset = charOffset; | 754 ..fileOffset = charOffset; |
| 755 } | 755 } |
| 756 } | 756 } |
| OLD | NEW |