Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: sdk/lib/_internal/compiler/js_lib/js_helper.dart

Issue 895813002: Tweak toString() for better type inference (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/async/zone.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/async/zone.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698