This repository was archived by the owner on Aug 5, 2024. It is now read-only.
File tree 4 files changed +2125
-5150
lines changed
4 files changed +2125
-5150
lines changed Original file line number Diff line number Diff line change @@ -1401,7 +1401,7 @@ class DiffMatchPatch {
1401
1401
param = param.replaceAll ('+' , '%2B' );
1402
1402
try {
1403
1403
param = Uri .decodeFull (param);
1404
- } on ArgumentError catch (e) {
1404
+ } on ArgumentError {
1405
1405
// Malformed URI sequence.
1406
1406
throw new ArgumentError ('Illegal escape in diff_fromDelta: $param ' );
1407
1407
}
@@ -1413,7 +1413,7 @@ class DiffMatchPatch {
1413
1413
int n;
1414
1414
try {
1415
1415
n = int .parse (param);
1416
- } on FormatException catch (e) {
1416
+ } on FormatException {
1417
1417
throw new ArgumentError ('Invalid number in diff_fromDelta: $param ' );
1418
1418
}
1419
1419
if (n < 0 ) {
@@ -1423,7 +1423,7 @@ class DiffMatchPatch {
1423
1423
String text;
1424
1424
try {
1425
1425
text = text1.substring (pointer, pointer += n);
1426
- } on RangeError catch (e) {
1426
+ } on RangeError {
1427
1427
throw new ArgumentError ('Delta length ($pointer )'
1428
1428
' larger than source text length (${text1 .length }).' );
1429
1429
}
@@ -2163,7 +2163,7 @@ class DiffMatchPatch {
2163
2163
String line;
2164
2164
try {
2165
2165
line = Uri .decodeFull (text[textPointer].substring (1 ));
2166
- } on ArgumentError catch (e) {
2166
+ } on ArgumentError {
2167
2167
// Malformed URI sequence.
2168
2168
throw new ArgumentError ('Illegal escape in patch_fromText: $line ' );
2169
2169
}
Original file line number Diff line number Diff line change @@ -52,6 +52,19 @@ class Diff {
52
52
* [other] is another Diff to compare against.
53
53
* Returns true or false.
54
54
*/
55
- bool operator == (Diff other) =>
56
- operation == other.operation && text == other.text;
55
+ @override
56
+ bool operator == (Object other) =>
57
+ identical (this , other) ||
58
+ other is Diff &&
59
+ runtimeType == other.runtimeType &&
60
+ operation == other.operation &&
61
+ text == other.text;
62
+
63
+ /**
64
+ * Generate a uniquely identifiable hashcode for this Diff.
65
+ * Returns numeric hashcode.
66
+ */
67
+ @override
68
+ int get hashCode =>
69
+ operation.hashCode ^ text.hashCode;
57
70
}
Original file line number Diff line number Diff line change 16
16
* limitations under the License.
17
17
*/
18
18
19
- // Can't import DiffMatchPatch library since the private functions would be
20
- // unavailable. Instead, import all the source files.
21
- import 'dart:collection' ;
22
- import 'dart:math' ;
23
19
import '../DiffMatchPatch.dart' ;
24
20
25
21
// Expect class disappeared from Dart unexpectedly. Here's a minimal shim.
@@ -43,7 +39,7 @@ class Expect {
43
39
static void throws (void f (), String msg) {
44
40
try {
45
41
f ();
46
- } catch (e, s ) {
42
+ } catch (e) {
47
43
return ;
48
44
}
49
45
throw new Exception ('Expect.throws($msg ) fails' );
You can’t perform that action at this time.
0 commit comments