| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart._runtime; | 4 part of dart._runtime; |
| 5 | 5 |
| 6 throwCastError(object, actual, type) => JS('', '''(() => { | 6 throwCastError(object, actual, type) => JS('', '''(() => { |
| 7 debugger; | 7 debugger; |
| 8 $throw_(new $CastErrorImplementation($object, | 8 $throw_(new $CastErrorImplementation($object, |
| 9 $typeName($actual), | 9 $typeName($actual), |
| 10 $typeName($type))); | 10 $typeName($type))); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 $throw_(new $StrongModeTypeError($object, | 29 $throw_(new $StrongModeTypeError($object, |
| 30 $typeName($actual), | 30 $typeName($actual), |
| 31 $typeName($type))); | 31 $typeName($type))); |
| 32 })()'''); | 32 })()'''); |
| 33 | 33 |
| 34 throwUnimplementedError(message) => JS('', '''(() => { | 34 throwUnimplementedError(message) => JS('', '''(() => { |
| 35 debugger; | 35 debugger; |
| 36 $throw_(new $UnimplementedError($message)); | 36 $throw_(new $UnimplementedError($message)); |
| 37 })()'''); | 37 })()'''); |
| 38 | 38 |
| 39 throwAssertionError() => JS('', '''(() => { | 39 throwAssertionError([message]) => JS('', '''(() => { |
| 40 debugger; | 40 debugger; |
| 41 $throw_(new $AssertionError()); | 41 let error = $message != null |
| 42 ? new $AssertionErrorWithMessage($message()) |
| 43 : new $AssertionError(); |
| 44 $throw_(error); |
| 42 })()'''); | 45 })()'''); |
| 43 | 46 |
| 44 throwNullValueError() => JS('', '''(() => { | 47 throwNullValueError() => JS('', '''(() => { |
| 45 // TODO(vsm): Per spec, we should throw an NSM here. Technically, we ought | 48 // TODO(vsm): Per spec, we should throw an NSM here. Technically, we ought |
| 46 // to thread through method info, but that uglifies the code and can't | 49 // to thread through method info, but that uglifies the code and can't |
| 47 // actually be queried ... it only affects how the error is printed. | 50 // actually be queried ... it only affects how the error is printed. |
| 48 debugger; | 51 debugger; |
| 49 $throw_(new $NoSuchMethodError(null, | 52 $throw_(new $NoSuchMethodError(null, |
| 50 new $Symbol('<Unexpected Null Value>'), null, null, null)); | 53 new $Symbol('<Unexpected Null Value>'), null, null, null)); |
| 51 })()'''); | 54 })()'''); |
| OLD | NEW |