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

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

Issue 9316100: Fix for issue 1307: throw runtime exception instead of reporting a compile time error if a static... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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 | « runtime/lib/error.cc ('k') | runtime/vm/bootstrap_natives.h » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Errors are created and thrown by DartVM only. 4 // Errors are created and thrown by DartVM only.
5 // Changes here should also be reflected in corelib/error.dart as well 5 // Changes here should also be reflected in corelib/error.dart as well
6 6
7 class AssertionError { 7 class AssertionError {
8 factory AssertionError._uninstantiable() { 8 factory AssertionError._uninstantiable() {
9 throw const UnsupportedOperationException( 9 throw const UnsupportedOperationException(
10 "AssertionError can only be allocated by the VM"); 10 "AssertionError can only be allocated by the VM");
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 final String url; 52 final String url;
53 final int line; 53 final int line;
54 } 54 }
55 55
56 class InternalError { 56 class InternalError {
57 const InternalError(this._msg); 57 const InternalError(this._msg);
58 String toString() => "InternalError: '${_msg}'"; 58 String toString() => "InternalError: '${_msg}'";
59 final String _msg; 59 final String _msg;
60 } 60 }
61
62
63 class StaticResolutionException implements Exception {
64 factory StaticResolutionException._uninstantiable() {
65 throw const UnsupportedOperationException(
66 "StaticResolutionException can only be allocated by the VM");
67 }
68
69 String toString() => "Unresolved static method: url '$url' line $line " +
70 "pos $column\n$failedResolutionLine\n";
71
72 static _throwNew(int token_pos) native "StaticResolutionException_throwNew";
73
74 final String failedResolutionLine;
75 final String url;
76 final int line;
77 final int column;
78 }
OLDNEW
« no previous file with comments | « runtime/lib/error.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698