Chromium Code Reviews| 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() => JS('', '''(() => { |
|
Jennifer Messerly
2016/12/12 22:36:02
throwAssertionError([message]) => JS('', '''(() =>
Bob Nystrom
2016/12/13 19:29:51
Done.
| |
| 40 debugger; | 40 debugger; |
| 41 $throw_(new $AssertionError()); | 41 $throw_(new $AssertionError()); |
| 42 })()'''); | 42 })()'''); |
| 43 | 43 |
| 44 throwAssertionErrorWithMessage(message) => JS( | |
|
Jennifer Messerly
2016/12/12 22:36:02
this can be removed per earlier suggestion
Bob Nystrom
2016/12/13 19:29:51
Done.
| |
| 45 '', | |
| 46 '''(() => { | |
| 47 debugger; | |
| 48 $throw_(new $AssertionErrorWithMessage($message)); | |
| 49 })()'''); | |
| 50 | |
| 44 throwNullValueError() => JS('', '''(() => { | 51 throwNullValueError() => JS('', '''(() => { |
| 45 // TODO(vsm): Per spec, we should throw an NSM here. Technically, we ought | 52 // 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 | 53 // 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. | 54 // actually be queried ... it only affects how the error is printed. |
| 48 debugger; | 55 debugger; |
| 49 $throw_(new $NoSuchMethodError(null, | 56 $throw_(new $NoSuchMethodError(null, |
| 50 new $Symbol('<Unexpected Null Value>'), null, null, null)); | 57 new $Symbol('<Unexpected Null Value>'), null, null, null)); |
| 51 })()'''); | 58 })()'''); |
| OLD | NEW |