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

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

Issue 10916039: Throw AbstractClassInstantiationError if an abstract class is instantiated (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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) 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 // 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 AssertionErrorImplementation implements AssertionError { 7 class AssertionErrorImplementation implements AssertionError {
8 factory AssertionErrorImplementation._uninstantiable() { 8 factory AssertionErrorImplementation._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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 String toString() => "Unresolved static method: url '$url' line $line " 100 String toString() => "Unresolved static method: url '$url' line $line "
101 "pos $column\n$failedResolutionLine\n"; 101 "pos $column\n$failedResolutionLine\n";
102 102
103 static _throwNew(int token_pos) native "StaticResolutionException_throwNew"; 103 static _throwNew(int token_pos) native "StaticResolutionException_throwNew";
104 104
105 final String failedResolutionLine; 105 final String failedResolutionLine;
106 final String url; 106 final String url;
107 final int line; 107 final int line;
108 final int column; 108 final int column;
109 } 109 }
110
111
112 class AbstractClassInstantiationErrorImplementation
113 implements AbstractClassInstantiationError {
114
115 factory AbstractClassInstantiationErrorImplementation._uninstantiable() {
116 throw const UnsupportedOperationException(
117 "AbstractClassInstantiationError can only be allocated by the VM");
118 }
119
120 static _throwNew(int case_clause_pos, String className)
121 native "AbstractClassInstantiationError_throwNew";
122
123 String toString() {
124 return "Cannot instantiate abstract class $className: "
125 "url '$url' line $line";
126 }
127
128 final String className;
129 final String url;
130 final int line;
131 }
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