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

Side by Side Diff: runtime/lib/errors_patch.dart

Issue 38563005: Throw CyclicInitializationError instead of string (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | runtime/vm/parser.cc » ('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) 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 patch class Error { 5 patch class Error {
6 /* patch */ static String _objectToString(Object object) { 6 /* patch */ static String _objectToString(Object object) {
7 return Object._toString(object); 7 return Object._toString(object);
8 } 8 }
9 9
10 /* patch */ StackTrace get stackTrace => _stackTrace; 10 /* patch */ StackTrace get stackTrace => _stackTrace;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 String _url; 103 String _url;
104 int _line; 104 int _line;
105 } 105 }
106 106
107 class _InternalError { 107 class _InternalError {
108 const _InternalError(this._msg); 108 const _InternalError(this._msg);
109 String toString() => "InternalError: '${_msg}'"; 109 String toString() => "InternalError: '${_msg}'";
110 final String _msg; 110 final String _msg;
111 } 111 }
112 112
113 patch class CyclicInitializationError {
114 static _throwNew(String variableName) {
115 throw new CyclicInitializationError(variableName);
116 }
117 }
113 118
114 patch class AbstractClassInstantiationError { 119 patch class AbstractClassInstantiationError {
115 AbstractClassInstantiationError._create( 120 AbstractClassInstantiationError._create(
116 this._className, this._url, this._line); 121 this._className, this._url, this._line);
117 122
118 static _throwNew(int case_clause_pos, String className) 123 static _throwNew(int case_clause_pos, String className)
119 native "AbstractClassInstantiationError_throwNew"; 124 native "AbstractClassInstantiationError_throwNew";
120 125
121 /* patch */ String toString() { 126 /* patch */ String toString() {
122 return "Cannot instantiate abstract class $_className: " 127 return "Cannot instantiate abstract class $_className: "
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 return msg_buf.toString(); 319 return msg_buf.toString();
315 } 320 }
316 } 321 }
317 322
318 class _JavascriptIntegerOverflowError extends Error { 323 class _JavascriptIntegerOverflowError extends Error {
319 final Object _value; 324 final Object _value;
320 325
321 _JavascriptIntegerOverflowError(this._value); 326 _JavascriptIntegerOverflowError(this._value);
322 String toString() => "Javascript Integer Overflow: $_value"; 327 String toString() => "Javascript Integer Overflow: $_value";
323 } 328 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698