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 | 21 |
21 import 'frontend_accessors.dart' as kernel show | 22 import 'frontend_accessors.dart' as kernel show |
22 IndexAccessor, | 23 IndexAccessor, |
23 NullAwarePropertyAccessor, | 24 NullAwarePropertyAccessor, |
24 PropertyAccessor, | 25 PropertyAccessor, |
25 StaticAccessor, | 26 StaticAccessor, |
26 SuperPropertyAccessor, | 27 SuperPropertyAccessor, |
27 ThisIndexAccessor, | 28 ThisIndexAccessor, |
28 ThisPropertyAccessor, | 29 ThisPropertyAccessor, |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 return buildMethodInvocation(buildSimpleRead(), new Name("call"), arguments, | 688 return buildMethodInvocation(buildSimpleRead(), new Name("call"), arguments, |
688 charOffset); | 689 charOffset); |
689 } | 690 } |
690 | 691 |
691 toString() => "VariableAccessor()"; | 692 toString() => "VariableAccessor()"; |
692 } | 693 } |
693 | 694 |
694 Expression throwNoSuchMethodError(String name, Arguments arguments, Uri uri, | 695 Expression throwNoSuchMethodError(String name, Arguments arguments, Uri uri, |
695 int charOffset, CoreTypes coreTypes, | 696 int charOffset, CoreTypes coreTypes, |
696 {bool isSuper: false, isGetter: false, isSetter: false}) { | 697 {bool isSuper: false, isGetter: false, isSetter: false}) { |
697 print("$uri:$charOffset: method not found: '$name'."); | 698 print(new InputError(uri, charOffset, "Method not found: '$name'.").format()); |
698 Constructor constructor = coreTypes.getCoreClass( | 699 Constructor constructor = coreTypes.getCoreClass( |
699 "dart:core", "NoSuchMethodError").constructors.first; | 700 "dart:core", "NoSuchMethodError").constructors.first; |
700 return new Throw(new ConstructorInvocation( | 701 return new Throw(new ConstructorInvocation( |
701 constructor, | 702 constructor, |
702 new Arguments(<Expression>[ | 703 new Arguments(<Expression>[ |
703 new NullLiteral(), | 704 new NullLiteral(), |
704 new SymbolLiteral(name), | 705 new SymbolLiteral(name), |
705 new ListLiteral(arguments.positional), | 706 new ListLiteral(arguments.positional), |
706 new MapLiteral(arguments.named.map((arg) { | 707 new MapLiteral(arguments.named.map((arg) { |
707 return new MapEntry(new SymbolLiteral(arg.name), arg.value); | 708 return new MapEntry(new SymbolLiteral(arg.name), arg.value); |
(...skipping 15 matching lines...) Expand all Loading... |
723 buildIsNull(new VariableGet(variable)), | 724 buildIsNull(new VariableGet(variable)), |
724 new NullLiteral(), | 725 new NullLiteral(), |
725 new MethodInvocation(new VariableGet(variable), name, arguments) | 726 new MethodInvocation(new VariableGet(variable), name, arguments) |
726 ..fileOffset = charOffset, | 727 ..fileOffset = charOffset, |
727 const DynamicType())); | 728 const DynamicType())); |
728 } else { | 729 } else { |
729 return new MethodInvocation(receiver, name, arguments) | 730 return new MethodInvocation(receiver, name, arguments) |
730 ..fileOffset = charOffset; | 731 ..fileOffset = charOffset; |
731 } | 732 } |
732 } | 733 } |
OLD | NEW |