Chromium Code Reviews| Index: runtime/lib/errors_patch.dart |
| diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart |
| index f26d4d4e238feb6c54a9618a043040da2ff5bd8e..1f57ad3d1fee038a37be4d0e6fdd760e806ff1bc 100644 |
| --- a/runtime/lib/errors_patch.dart |
| +++ b/runtime/lib/errors_patch.dart |
| @@ -395,3 +395,21 @@ class _CompileTimeError extends Error { |
| _CompileTimeError(this._errorMsg); |
| String toString() => _errorMsg; |
| } |
| + |
| +dynamic _classRangeAssert(int position, String InTypeCast, dynamic instance, |
| + _Type type, int cid, int lowerLimit, int upperLimit) { |
| + if ((cid < lowerLimit || cid > upperLimit) && instance != null) { |
| + _TypeError._throwNew(0, instance, type, InTypeCast, ""); |
|
rmacnak
2017/04/10 21:07:23
0 -> position.
It's safe to say "in type type" he
|
| + } |
| + |
| + return instance; |
| +} |
| + |
| +dynamic _classIdEqualsAssert(int position, String InTypeCast, dynamic instance, |
| + _Type type, int cid, int otherCid) { |
| + if (cid != otherCid && instance != null) { |
| + _TypeError._throwNew(0, instance, type, InTypeCast, ""); |
| + } |
| + |
| + return instance; |
| +} |