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

Side by Side Diff: sdk/lib/_internal/lib/js_number.dart

Issue 236313012: Don't hide interceptors in mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 7 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 | « sdk/lib/_internal/lib/js_names.dart ('k') | sdk/lib/_internal/lib/js_rti.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 part of _interceptors; 5 part of _interceptors;
6 6
7 /** 7 /**
8 * The super interceptor class for [JSInt] and [JSDouble]. The compiler 8 * The super interceptor class for [JSInt] and [JSDouble]. The compiler
9 * recognizes this class as an interceptor, and changes references to 9 * recognizes this class as an interceptor, and changes references to
10 * [:this:] to actually use the receiver of the method, which is 10 * [:this:] to actually use the receiver of the method, which is
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 bool operator <=(num other) { 303 bool operator <=(num other) {
304 if (other is !num) throw new ArgumentError(other); 304 if (other is !num) throw new ArgumentError(other);
305 return JS('bool', '# <= #', this, other); 305 return JS('bool', '# <= #', this, other);
306 } 306 }
307 307
308 bool operator >=(num other) { 308 bool operator >=(num other) {
309 if (other is !num) throw new ArgumentError(other); 309 if (other is !num) throw new ArgumentError(other);
310 return JS('bool', '# >= #', this, other); 310 return JS('bool', '# >= #', this, other);
311 } 311 }
312
313 Type get runtimeType => num;
312 } 314 }
313 315
314 /** 316 /**
315 * The interceptor class for [int]s. 317 * The interceptor class for [int]s.
316 * 318 *
317 * This class implements double since in JavaScript all numbers are doubles, so 319 * This class implements double since in JavaScript all numbers are doubles, so
318 * while we want to treat `2.0` as an integer for some operations, its 320 * while we want to treat `2.0` as an integer for some operations, its
319 * interceptor should answer `true` to `is double`. 321 * interceptor should answer `true` to `is double`.
320 */ 322 */
321 class JSInt extends JSNumber implements int, double { 323 class JSInt extends JSNumber implements int, double {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 392 }
391 393
392 class JSDouble extends JSNumber implements double { 394 class JSDouble extends JSNumber implements double {
393 const JSDouble(); 395 const JSDouble();
394 Type get runtimeType => double; 396 Type get runtimeType => double;
395 } 397 }
396 398
397 class JSPositiveInt extends JSInt {} 399 class JSPositiveInt extends JSInt {}
398 class JSUInt32 extends JSPositiveInt {} 400 class JSUInt32 extends JSPositiveInt {}
399 class JSUInt31 extends JSUInt32 {} 401 class JSUInt31 extends JSUInt32 {}
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/js_names.dart ('k') | sdk/lib/_internal/lib/js_rti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698