| 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 } | 750 } |
| 751 | 751 |
| 752 static double random() => JS('double', @'Math.random()'); | 752 static double random() => JS('double', @'Math.random()'); |
| 753 } | 753 } |
| 754 | 754 |
| 755 /** | 755 /** |
| 756 * Called by generated code to capture the stacktrace before throwing | 756 * Called by generated code to capture the stacktrace before throwing |
| 757 * an exception. | 757 * an exception. |
| 758 */ | 758 */ |
| 759 captureStackTrace(ex) { | 759 captureStackTrace(ex) { |
| 760 if (ex === null) ex = const NullPointerException(); |
| 760 var jsError = JS('Object', @'new Error()'); | 761 var jsError = JS('Object', @'new Error()'); |
| 761 JS('void', @'#.dartException = #', jsError, ex); | 762 JS('void', @'#.dartException = #', jsError, ex); |
| 762 JS('void', @'''#.toString = #''', jsError, | 763 JS('void', @'''#.toString = #''', jsError, |
| 763 DART_CLOSURE_TO_JS(toStringWrapper)); | 764 DART_CLOSURE_TO_JS(toStringWrapper)); |
| 764 return jsError; | 765 return jsError; |
| 765 } | 766 } |
| 766 | 767 |
| 767 /** | 768 /** |
| 768 * This method is installed as JavaScript toString method on exception | 769 * This method is installed as JavaScript toString method on exception |
| 769 * objects in [captureStackTrace]. So JavaScript 'this' binds to an | 770 * objects in [captureStackTrace]. So JavaScript 'this' binds to an |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 propertyTypeCastError(value, property); | 1185 propertyTypeCastError(value, property); |
| 1185 } | 1186 } |
| 1186 | 1187 |
| 1187 /** | 1188 /** |
| 1188 * Special interface recognized by the compiler and implemented by DOM | 1189 * Special interface recognized by the compiler and implemented by DOM |
| 1189 * objects that support integer indexing. This interface is not | 1190 * objects that support integer indexing. This interface is not |
| 1190 * visible to anyone, and is only injected into special libraries. | 1191 * visible to anyone, and is only injected into special libraries. |
| 1191 */ | 1192 */ |
| 1192 interface JavaScriptIndexingBehavior { | 1193 interface JavaScriptIndexingBehavior { |
| 1193 } | 1194 } |
| OLD | NEW |