| 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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 } | 937 } |
| 938 | 938 |
| 939 DartType get setterType { | 939 DartType get setterType { |
| 940 return isSetter | 940 return isSetter |
| 941 ? function.positionalParameters[0].type | 941 ? function.positionalParameters[0].type |
| 942 : const BottomType(); | 942 : const BottomType(); |
| 943 } | 943 } |
| 944 | 944 |
| 945 _MemberAccessor get _getterInterface => _reference; | 945 _MemberAccessor get _getterInterface => _reference; |
| 946 _MemberAccessor get _setterInterface => _reference; | 946 _MemberAccessor get _setterInterface => _reference; |
| 947 |
| 948 Location _getLocationInEnclosingFile(int offset) { |
| 949 return enclosingProgram.getLocation(fileUri, offset); |
| 950 } |
| 947 } | 951 } |
| 948 | 952 |
| 949 enum ProcedureKind { | 953 enum ProcedureKind { |
| 950 Method, | 954 Method, |
| 951 Getter, | 955 Getter, |
| 952 Setter, | 956 Setter, |
| 953 Operator, | 957 Operator, |
| 954 Factory, | 958 Factory, |
| 955 } | 959 } |
| 956 | 960 |
| (...skipping 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3540 int pivot = lines[mid]; | 3544 int pivot = lines[mid]; |
| 3541 if (pivot <= offset) { | 3545 if (pivot <= offset) { |
| 3542 low = mid; | 3546 low = mid; |
| 3543 } else { | 3547 } else { |
| 3544 high = mid - 1; | 3548 high = mid - 1; |
| 3545 } | 3549 } |
| 3546 } | 3550 } |
| 3547 int lineIndex = low; | 3551 int lineIndex = low; |
| 3548 int lineStart = lines[lineIndex]; | 3552 int lineStart = lines[lineIndex]; |
| 3549 int lineNumber = 1 + lineIndex; | 3553 int lineNumber = 1 + lineIndex; |
| 3550 int columnNumber = offset - lineStart; | 3554 int columnNumber = 1 + offset - lineStart; |
| 3551 return new Location(file, lineNumber, columnNumber); | 3555 return new Location(file, lineNumber, columnNumber); |
| 3552 } | 3556 } |
| 3553 } | 3557 } |
| 3554 | 3558 |
| 3555 /// A tuple with file, line, and column number, for displaying human-readable | 3559 /// A tuple with file, line, and column number, for displaying human-readable |
| 3556 /// locations. | 3560 /// locations. |
| 3557 class Location { | 3561 class Location { |
| 3558 final String file; | 3562 final String file; |
| 3559 final int line; // 1-based. | 3563 final int line; // 1-based. |
| 3560 final int column; // 1-based. | 3564 final int column; // 1-based. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3651 } | 3655 } |
| 3652 } | 3656 } |
| 3653 } | 3657 } |
| 3654 | 3658 |
| 3655 class Source { | 3659 class Source { |
| 3656 final List<int> lineStarts; | 3660 final List<int> lineStarts; |
| 3657 final String source; | 3661 final String source; |
| 3658 | 3662 |
| 3659 Source(this.lineStarts, this.source); | 3663 Source(this.lineStarts, this.source); |
| 3660 } | 3664 } |
| OLD | NEW |