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

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

Issue 25674017: Fix runtimeType for strings, integers and double: return their interface type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/lib/double.dart ('k') | runtime/lib/mirrors.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 // 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 new UnsupportedError( 9 throw new UnsupportedError(
10 "_IntegerImplementation can only be allocated by the VM"); 10 "_IntegerImplementation can only be allocated by the VM");
11 } 11 }
12
13 Type get runtimeType => int;
14
12 num operator +(num other) { 15 num operator +(num other) {
13 return other._addFromInteger(this); 16 return other._addFromInteger(this);
14 } 17 }
15 num operator -(num other) { 18 num operator -(num other) {
16 return other._subFromInteger(this); 19 return other._subFromInteger(this);
17 } 20 }
18 num operator *(num other) { 21 num operator *(num other) {
19 return other._mulFromInteger(this); 22 return other._mulFromInteger(this);
20 } 23 }
21 num operator ~/(num other) { 24 num operator ~/(num other) {
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 } else { 333 } else {
331 return 0; 334 return 0;
332 } 335 }
333 } 336 }
334 int _shlFromInt(int other) native "Bigint_shlFromInt"; 337 int _shlFromInt(int other) native "Bigint_shlFromInt";
335 338
336 int pow(int exponent) { 339 int pow(int exponent) {
337 throw "Bigint.pow not implemented"; 340 throw "Bigint.pow not implemented";
338 } 341 }
339 } 342 }
OLDNEW
« no previous file with comments | « runtime/lib/double.dart ('k') | runtime/lib/mirrors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698