| 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 4009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4020 if (node == child) { | 4020 if (node == child) { |
| 4021 return replacement; | 4021 return replacement; |
| 4022 } else { | 4022 } else { |
| 4023 return node; | 4023 return node; |
| 4024 } | 4024 } |
| 4025 } | 4025 } |
| 4026 } | 4026 } |
| 4027 | 4027 |
| 4028 class Source { | 4028 class Source { |
| 4029 final List<int> lineStarts; | 4029 final List<int> lineStarts; |
| 4030 final String source; | 4030 final List<int> source; |
| 4031 | 4031 |
| 4032 Source(this.lineStarts, this.source); | 4032 Source(this.lineStarts, this.source); |
| 4033 } | 4033 } |
| 4034 | 4034 |
| 4035 /// Returns the [Reference] object for the given member. | 4035 /// Returns the [Reference] object for the given member. |
| 4036 /// | 4036 /// |
| 4037 /// Returns `null` if the member is `null`. | 4037 /// Returns `null` if the member is `null`. |
| 4038 Reference getMemberReference(Member member) { | 4038 Reference getMemberReference(Member member) { |
| 4039 return member?.reference; | 4039 return member?.reference; |
| 4040 } | 4040 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4074 /// library has not been assigned a canonical name yet. | 4074 /// library has not been assigned a canonical name yet. |
| 4075 /// | 4075 /// |
| 4076 /// Returns `null` if the library is `null`. | 4076 /// Returns `null` if the library is `null`. |
| 4077 CanonicalName getCanonicalNameOfLibrary(Library library) { | 4077 CanonicalName getCanonicalNameOfLibrary(Library library) { |
| 4078 if (library == null) return null; | 4078 if (library == null) return null; |
| 4079 if (library.canonicalName == null) { | 4079 if (library.canonicalName == null) { |
| 4080 throw '$library has no canonical name'; | 4080 throw '$library has no canonical name'; |
| 4081 } | 4081 } |
| 4082 return library.canonicalName; | 4082 return library.canonicalName; |
| 4083 } | 4083 } |
| OLD | NEW |