OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 @patch | 5 @patch |
6 class Error { | 6 class Error { |
7 @patch | 7 @patch |
8 static String _objectToString(Object object) { | 8 static String _objectToString(Object object) { |
9 return Object._toString(object); | 9 return Object._toString(object); |
10 } | 10 } |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 388 |
389 return msg_buf.toString(); | 389 return msg_buf.toString(); |
390 } | 390 } |
391 } | 391 } |
392 | 392 |
393 class _CompileTimeError extends Error { | 393 class _CompileTimeError extends Error { |
394 final String _errorMsg; | 394 final String _errorMsg; |
395 _CompileTimeError(this._errorMsg); | 395 _CompileTimeError(this._errorMsg); |
396 String toString() => _errorMsg; | 396 String toString() => _errorMsg; |
397 } | 397 } |
| 398 |
| 399 dynamic _classRangeAssert(int position, dynamic instance, _Type type, int cid, |
| 400 int lowerLimit, int upperLimit) { |
| 401 if ((cid < lowerLimit || cid > upperLimit) && instance != null) { |
| 402 _TypeError._throwNew(position, instance, type, " in type cast", null); |
| 403 } |
| 404 |
| 405 return instance; |
| 406 } |
| 407 |
| 408 dynamic _classIdEqualsAssert( |
| 409 int position, dynamic instance, _Type type, int cid, int otherCid) { |
| 410 if (cid != otherCid && instance != null) { |
| 411 _TypeError._throwNew(position, instance, type, " in type cast", null); |
| 412 } |
| 413 |
| 414 return instance; |
| 415 } |
OLD | NEW |