| 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 #library('js_helper'); | 5 #library('js_helper'); |
| 6 | 6 |
| 7 #import('coreimpl.dart'); | 7 #import('coreimpl.dart'); |
| 8 | 8 |
| 9 #source('constant_map.dart'); | 9 #source('constant_map.dart'); |
| 10 #source('native_helper.dart'); | 10 #source('native_helper.dart'); |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 return new StackOverflowException(); | 822 return new StackOverflowException(); |
| 823 } | 823 } |
| 824 | 824 |
| 825 // In general, a RangeError is thrown when trying to pass a number | 825 // In general, a RangeError is thrown when trying to pass a number |
| 826 // as an argument to a function that does not allow a range that | 826 // as an argument to a function that does not allow a range that |
| 827 // includes that number. | 827 // includes that number. |
| 828 return new IllegalArgumentException(); | 828 return new IllegalArgumentException(); |
| 829 } | 829 } |
| 830 | 830 |
| 831 // Check for the Firefox specific stack overflow signal. | 831 // Check for the Firefox specific stack overflow signal. |
| 832 if (JS('bool', @'InternalError && # instanceof InternalError', ex)) { | 832 if (JS('bool', |
| 833 @"typeof InternalError == 'object' && # instanceof InternalError", |
| 834 ex)) { |
| 833 if (message is String && message == 'too much recursion') { | 835 if (message is String && message == 'too much recursion') { |
| 834 return new StackOverflowException(); | 836 return new StackOverflowException(); |
| 835 } | 837 } |
| 836 } | 838 } |
| 837 | 839 |
| 838 // Last resort: Create a completely generic exception object and use | 840 // Last resort: Create a completely generic exception object and use |
| 839 // the JS exception message as its argument. | 841 // the JS exception message as its argument. |
| 840 return new Exception(message); | 842 return new Exception(message); |
| 841 } | 843 } |
| 842 | 844 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 if (JS('bool', '!!#[#]', value, property)) return value; | 1062 if (JS('bool', '!!#[#]', value, property)) return value; |
| 1061 propertyTypeError(value, property); | 1063 propertyTypeError(value, property); |
| 1062 } | 1064 } |
| 1063 | 1065 |
| 1064 listSuperNativeTypeCheck(value, property) { | 1066 listSuperNativeTypeCheck(value, property) { |
| 1065 if (value === null) return value; | 1067 if (value === null) return value; |
| 1066 if (value is List) return value; | 1068 if (value is List) return value; |
| 1067 if (JS('bool', '#[#]()', value, property)) return value; | 1069 if (JS('bool', '#[#]()', value, property)) return value; |
| 1068 propertyTypeError(value, property); | 1070 propertyTypeError(value, property); |
| 1069 } | 1071 } |
| OLD | NEW |