Chromium Code Reviews| Index: runtime/lib/error.dart |
| =================================================================== |
| --- runtime/lib/error.dart (revision 4727) |
| +++ runtime/lib/error.dart (working copy) |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| // Errors are created and thrown by DartVM only. |
| @@ -29,15 +29,21 @@ |
| static _throwNew(int location, |
| Object src_value, |
| String dst_type_name, |
| - String dst_name) |
| + String dst_name, |
| + String malformed_error) |
| native "TypeError_throwNew"; |
| String toString() { |
| - return "'$url': Failed type check: line $line pos $column: " + |
| - "type '$srcType' is not assignable to type '$dstType' of '$dstName'."; |
| + if (malformedError != null) { |
| + return malformedError; |
| + } else { |
| + return "'$url': Failed type check: line $line pos $column: " + |
|
srdjan
2012/02/29 00:15:54
no else is needed
regis
2012/02/29 02:10:01
Done.
|
| + "type '$srcType' is not assignable to type '$dstType' of '$dstName'."; |
| + } |
| } |
| final String srcType; |
| final String dstType; |
| final String dstName; |
| + final String malformedError; |
| } |
| class FallThroughError { |
| @@ -70,7 +76,7 @@ |
| "pos $column\n$failedResolutionLine\n"; |
| static _throwNew(int token_pos) native "StaticResolutionException_throwNew"; |
| - |
| + |
| final String failedResolutionLine; |
| final String url; |
| final int line; |