| 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 /// ----------------------------------------------------------------------- | 5 /// ----------------------------------------------------------------------- |
| 6 /// ERROR HANDLING | 6 /// ERROR HANDLING |
| 7 /// ----------------------------------------------------------------------- | 7 /// ----------------------------------------------------------------------- |
| 8 /// | 8 /// |
| 9 /// As a rule of thumb, errors that can be detected statically are handled by | 9 /// As a rule of thumb, errors that can be detected statically are handled by |
| 10 /// the frontend, typically by translating the erroneous code into a 'throw' or | 10 /// the frontend, typically by translating the erroneous code into a 'throw' or |
| (...skipping 4001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4012 if (node == child) { | 4012 if (node == child) { |
| 4013 return replacement; | 4013 return replacement; |
| 4014 } else { | 4014 } else { |
| 4015 return node; | 4015 return node; |
| 4016 } | 4016 } |
| 4017 } | 4017 } |
| 4018 } | 4018 } |
| 4019 | 4019 |
| 4020 class Source { | 4020 class Source { |
| 4021 final List<int> lineStarts; | 4021 final List<int> lineStarts; |
| 4022 final String source; | 4022 final List<int> source; |
| 4023 | 4023 |
| 4024 Source(this.lineStarts, this.source); | 4024 Source(this.lineStarts, this.source); |
| 4025 } | 4025 } |
| 4026 | 4026 |
| 4027 /// Returns the [Reference] object for the given member. | 4027 /// Returns the [Reference] object for the given member. |
| 4028 /// | 4028 /// |
| 4029 /// Returns `null` if the member is `null`. | 4029 /// Returns `null` if the member is `null`. |
| 4030 Reference getMemberReference(Member member) { | 4030 Reference getMemberReference(Member member) { |
| 4031 return member?.reference; | 4031 return member?.reference; |
| 4032 } | 4032 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4066 /// library has not been assigned a canonical name yet. | 4066 /// library has not been assigned a canonical name yet. |
| 4067 /// | 4067 /// |
| 4068 /// Returns `null` if the library is `null`. | 4068 /// Returns `null` if the library is `null`. |
| 4069 CanonicalName getCanonicalNameOfLibrary(Library library) { | 4069 CanonicalName getCanonicalNameOfLibrary(Library library) { |
| 4070 if (library == null) return null; | 4070 if (library == null) return null; |
| 4071 if (library.canonicalName == null) { | 4071 if (library.canonicalName == null) { |
| 4072 throw '$library has no canonical name'; | 4072 throw '$library has no canonical name'; |
| 4073 } | 4073 } |
| 4074 return library.canonicalName; | 4074 return library.canonicalName; |
| 4075 } | 4075 } |
| OLD | NEW |