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

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

Issue 778063002: Implement correct semantics of Boolean Conversion (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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/code_generator.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 import 'dart:mirrors' show MirrorSystem; 5 import 'dart:mirrors' show MirrorSystem;
6 import 'dart:convert' show JSON; 6 import 'dart:convert' show JSON;
7 7
8 patch class Error { 8 patch class Error {
9 /* patch */ static String _objectToString(Object object) { 9 /* patch */ static String _objectToString(Object object) {
10 return Object._toString(object); 10 return Object._toString(object);
11 } 11 }
12 12
13 /* patch */ static String _stringToSafeString(String string) { 13 /* patch */ static String _stringToSafeString(String string) {
14 return JSON.encode(string); 14 return JSON.encode(string);
15 } 15 }
16 16
17 /* patch */ StackTrace get stackTrace => _stackTrace; 17 /* patch */ StackTrace get stackTrace => _stackTrace;
18 18
19 StackTrace _stackTrace; 19 StackTrace _stackTrace;
20 } 20 }
21 21
22 class _AssertionError extends Error implements AssertionError { 22 class _AssertionError extends Error implements AssertionError {
23 _AssertionError._create( 23 _AssertionError._create(
24 this._failedAssertion, this._url, this._line, this._column); 24 this._failedAssertion, this._url, this._line, this._column);
25 25
26 static _throwNew(int assertionStart, int assertionEnd) 26 static _throwNew(int assertionStart, int assertionEnd)
27 native "AssertionError_throwNew"; 27 native "AssertionError_throwNew";
28 28
29 String toString() { 29 String toString() {
30 if (_url == null) {
31 return _failedAssertion;
32 }
30 var columnInfo = ""; 33 var columnInfo = "";
31 if (_column > 0) { 34 if (_column > 0) {
32 // Only add column information if it is valid. 35 // Only add column information if it is valid.
33 columnInfo = " pos $_column"; 36 columnInfo = " pos $_column";
34 } 37 }
35 return "'$_url': Failed assertion: line $_line$columnInfo: " 38 return "'$_url': Failed assertion: line $_line$columnInfo: "
36 "'$_failedAssertion' is not true."; 39 "'$_failedAssertion' is not true.";
37 } 40 }
38 final String _failedAssertion; 41 final String _failedAssertion;
39 final String _url; 42 final String _url;
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 String toString() => "Javascript Integer Overflow: $_value"; 345 String toString() => "Javascript Integer Overflow: $_value";
343 } 346 }
344 347
345 class _JavascriptCompatibilityError extends Error { 348 class _JavascriptCompatibilityError extends Error {
346 final String _msg; 349 final String _msg;
347 350
348 _JavascriptCompatibilityError(this._msg); 351 _JavascriptCompatibilityError(this._msg);
349 String toString() => "Javascript Compatibility Error: $_msg"; 352 String toString() => "Javascript Compatibility Error: $_msg";
350 } 353 }
351 354
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698