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

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

Issue 11229003: Revert "Rename OutOfMemoryException to OutOfMemoryError." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « lib/coreimpl/exceptions.dart ('k') | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('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 // TODO(srdjan): fix limitations. 5 // TODO(srdjan): fix limitations.
6 // - shift amount must be a Smi. 6 // - shift amount must be a Smi.
7 class _IntegerImplementation { 7 class _IntegerImplementation {
8 factory _IntegerImplementation._uninstantiable() { 8 factory _IntegerImplementation._uninstantiable() {
9 throw const UnsupportedOperationException( 9 throw const UnsupportedOperationException(
10 "_IntegerImplementation can only be allocated by the VM"); 10 "_IntegerImplementation can only be allocated by the VM");
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 // Shift by mint exceeds range that can be handled by the VM. 207 // Shift by mint exceeds range that can be handled by the VM.
208 int _shrFromInt(int other) { 208 int _shrFromInt(int other) {
209 if (other < 0) { 209 if (other < 0) {
210 return -1; 210 return -1;
211 } else { 211 } else {
212 return 0; 212 return 0;
213 } 213 }
214 } 214 }
215 int _shlFromInt(int other) { 215 int _shlFromInt(int other) {
216 throw const OutOfMemoryError(); 216 throw const OutOfMemoryException();
217 } 217 }
218 } 218 }
219 219
220 // A number that can be represented as Smi or Mint will never be represented as 220 // A number that can be represented as Smi or Mint will never be represented as
221 // Bigint. 221 // Bigint.
222 class _Bigint extends _IntegerImplementation implements int { 222 class _Bigint extends _IntegerImplementation implements int {
223 factory _Bigint._uninstantiable() { 223 factory _Bigint._uninstantiable() {
224 throw const UnsupportedOperationException( 224 throw const UnsupportedOperationException(
225 "_Bigint can only be allocated by the VM"); 225 "_Bigint can only be allocated by the VM");
226 } 226 }
227 int hashCode() { 227 int hashCode() {
228 return this; 228 return this;
229 } 229 }
230 int operator ~() native "Bigint_bitNegate"; 230 int operator ~() native "Bigint_bitNegate";
231 231
232 // Shift by bigint exceeds range that can be handled by the VM. 232 // Shift by bigint exceeds range that can be handled by the VM.
233 int _shrFromInt(int other) { 233 int _shrFromInt(int other) {
234 if (other < 0) { 234 if (other < 0) {
235 return -1; 235 return -1;
236 } else { 236 } else {
237 return 0; 237 return 0;
238 } 238 }
239 } 239 }
240 int _shlFromInt(int other) { 240 int _shlFromInt(int other) {
241 throw const OutOfMemoryError(); 241 throw const OutOfMemoryException();
242 } 242 }
243 243
244 int pow(int exponent) { 244 int pow(int exponent) {
245 throw "Bigint.pow not implemented"; 245 throw "Bigint.pow not implemented";
246 } 246 }
247 } 247 }
OLDNEW
« no previous file with comments | « lib/coreimpl/exceptions.dart ('k') | runtime/tests/vm/dart/isolate_mirror_local_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698