| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 'dart:_js_embedded_names' show | 7 import 'dart:_js_embedded_names' show |
| 8 ALL_CLASSES, | 8 ALL_CLASSES, |
| 9 GET_ISOLATE_TAG, | 9 GET_ISOLATE_TAG, |
| 10 INTERCEPTED_NAMES, | 10 INTERCEPTED_NAMES, |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 | 575 |
| 576 static int objectHashCode(object) { | 576 static int objectHashCode(object) { |
| 577 int hash = JS('int|Null', r'#.$identityHash', object); | 577 int hash = JS('int|Null', r'#.$identityHash', object); |
| 578 if (hash == null) { | 578 if (hash == null) { |
| 579 hash = JS('int', '(Math.random() * 0x3fffffff) | 0'); | 579 hash = JS('int', '(Math.random() * 0x3fffffff) | 0'); |
| 580 JS('void', r'#.$identityHash = #', object, hash); | 580 JS('void', r'#.$identityHash = #', object, hash); |
| 581 } | 581 } |
| 582 return JS('int', '#', hash); | 582 return JS('int', '#', hash); |
| 583 } | 583 } |
| 584 | 584 |
| 585 static _throwFormatException(String string) { | 585 static Null _throwFormatException(String string) { |
| 586 throw new FormatException(string); | 586 throw new FormatException(string); |
| 587 } | 587 } |
| 588 | 588 |
| 589 static int parseInt(String source, | 589 static int parseInt(String source, |
| 590 int radix, | 590 int radix, |
| 591 int handleError(String source)) { | 591 int handleError(String source)) { |
| 592 if (handleError == null) handleError = _throwFormatException; | 592 if (handleError == null) handleError = _throwFormatException; |
| 593 | 593 |
| 594 checkString(source); | 594 checkString(source); |
| 595 var match = JS('JSExtendableArray|Null', | 595 var match = JS('JSExtendableArray|Null', |
| (...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3455 throw new MainError("No top-level function named 'main'."); | 3455 throw new MainError("No top-level function named 'main'."); |
| 3456 } | 3456 } |
| 3457 | 3457 |
| 3458 void badMain() { | 3458 void badMain() { |
| 3459 throw new MainError("'main' is not a function."); | 3459 throw new MainError("'main' is not a function."); |
| 3460 } | 3460 } |
| 3461 | 3461 |
| 3462 void mainHasTooManyParameters() { | 3462 void mainHasTooManyParameters() { |
| 3463 throw new MainError("'main' expects too many parameters."); | 3463 throw new MainError("'main' expects too many parameters."); |
| 3464 } | 3464 } |
| OLD | NEW |