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 GET_TYPE_FROM_NAME, | 8 GET_TYPE_FROM_NAME, |
9 GET_ISOLATE_TAG, | 9 GET_ISOLATE_TAG, |
10 INTERCEPTED_NAMES, | 10 INTERCEPTED_NAMES, |
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 * exception. Should never return null. | 1822 * exception. Should never return null. |
1823 */ | 1823 */ |
1824 StackTrace getTraceFromException(exception) => new _StackTrace(exception); | 1824 StackTrace getTraceFromException(exception) => new _StackTrace(exception); |
1825 | 1825 |
1826 class _StackTrace implements StackTrace { | 1826 class _StackTrace implements StackTrace { |
1827 var _exception; | 1827 var _exception; |
1828 String _trace; | 1828 String _trace; |
1829 _StackTrace(this._exception); | 1829 _StackTrace(this._exception); |
1830 | 1830 |
1831 String toString() { | 1831 String toString() { |
1832 if (_trace != null) return _trace; | 1832 if (_trace != null) return JS('String', '#', _trace); |
1833 | 1833 |
1834 String trace; | 1834 String trace; |
1835 if (JS('bool', 'typeof # === "object"', _exception)) { | 1835 if (JS('bool', 'typeof # === "object"', _exception)) { |
1836 trace = JS("String|Null", r"#.stack", _exception); | 1836 trace = JS("String|Null", r"#.stack", _exception); |
1837 } | 1837 } |
1838 return _trace = (trace == null) ? '' : trace; | 1838 return _trace = (trace == null) ? '' : trace; |
1839 } | 1839 } |
1840 } | 1840 } |
1841 | 1841 |
1842 int objectHashCode(var object) { | 1842 int objectHashCode(var object) { |
(...skipping 1612 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 |