| 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 'shared/embedded_names.dart' show | 7 import 'shared/embedded_names.dart' show |
| 8 ALL_CLASSES, | 8 ALL_CLASSES, |
| 9 GET_ISOLATE_TAG, | 9 GET_ISOLATE_TAG, |
| 10 INTERCEPTED_NAMES, | 10 INTERCEPTED_NAMES, |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 } | 819 } |
| 820 } | 820 } |
| 821 throw new RangeError.range(charCode, 0, 0x10ffff); | 821 throw new RangeError.range(charCode, 0, 0x10ffff); |
| 822 } | 822 } |
| 823 | 823 |
| 824 static String stringConcatUnchecked(String string1, String string2) { | 824 static String stringConcatUnchecked(String string1, String string2) { |
| 825 return JS_STRING_CONCAT(string1, string2); | 825 return JS_STRING_CONCAT(string1, string2); |
| 826 } | 826 } |
| 827 | 827 |
| 828 static String flattenString(String str) { | 828 static String flattenString(String str) { |
| 829 return JS('', "#.charCodeAt(0) == 0 ? # : #", str, str, str); | 829 return JS('String', "#.charCodeAt(0) == 0 ? # : #", str, str, str); |
| 830 } | 830 } |
| 831 | 831 |
| 832 static String getTimeZoneName(receiver) { | 832 static String getTimeZoneName(receiver) { |
| 833 // Firefox and Chrome emit the timezone in parenthesis. | 833 // Firefox and Chrome emit the timezone in parenthesis. |
| 834 // Example: "Wed May 16 2012 21:13:00 GMT+0200 (CEST)". | 834 // Example: "Wed May 16 2012 21:13:00 GMT+0200 (CEST)". |
| 835 // We extract this name using a regexp. | 835 // We extract this name using a regexp. |
| 836 var d = lazyAsJsDate(receiver); | 836 var d = lazyAsJsDate(receiver); |
| 837 List match = JS('JSArray|Null', r'/\((.*)\)/.exec(#.toString())', d); | 837 List match = JS('JSArray|Null', r'/\((.*)\)/.exec(#.toString())', d); |
| 838 if (match != null) return match[1]; | 838 if (match != null) return match[1]; |
| 839 | 839 |
| (...skipping 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3408 throw new MainError("No top-level function named 'main'."); | 3408 throw new MainError("No top-level function named 'main'."); |
| 3409 } | 3409 } |
| 3410 | 3410 |
| 3411 void badMain() { | 3411 void badMain() { |
| 3412 throw new MainError("'main' is not a function."); | 3412 throw new MainError("'main' is not a function."); |
| 3413 } | 3413 } |
| 3414 | 3414 |
| 3415 void mainHasTooManyParameters() { | 3415 void mainHasTooManyParameters() { |
| 3416 throw new MainError("'main' expects too many parameters."); | 3416 throw new MainError("'main' expects too many parameters."); |
| 3417 } | 3417 } |
| OLD | NEW |