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

Side by Side Diff: lib/compiler/implementation/lib/interceptors.dart

Issue 10850034: Rename BadNumberFormatException -> FormatException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to reviews, rebase, and merge. Created 8 years, 4 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
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 #library('dart:_interceptors'); 5 #library('dart:_interceptors');
6 6
7 #import('coreimpl.dart'); 7 #import('coreimpl.dart');
8 #import('js_helper.dart'); 8 #import('js_helper.dart');
9 9
10 add$1(var receiver, var value) { 10 add$1(var receiver, var value) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 372
373 abs(receiver) { 373 abs(receiver) {
374 if (receiver is !num) return UNINTERCEPTED(receiver.abs()); 374 if (receiver is !num) return UNINTERCEPTED(receiver.abs());
375 375
376 return JS('num', @'Math.abs(#)', receiver); 376 return JS('num', @'Math.abs(#)', receiver);
377 } 377 }
378 378
379 toInt(receiver) { 379 toInt(receiver) {
380 if (receiver is !num) return UNINTERCEPTED(receiver.toInt()); 380 if (receiver is !num) return UNINTERCEPTED(receiver.toInt());
381 381
382 if (receiver.isNaN()) throw new BadNumberFormatException('NaN'); 382 if (receiver.isNaN()) throw new FormatException('NaN');
383 383
384 if (receiver.isInfinite()) throw new BadNumberFormatException('Infinity'); 384 if (receiver.isInfinite()) throw new FormatException('Infinity');
385 385
386 var truncated = receiver.truncate(); 386 var truncated = receiver.truncate();
387 return JS('bool', @'# == -0.0', truncated) ? 0 : truncated; 387 return JS('bool', @'# == -0.0', truncated) ? 0 : truncated;
388 } 388 }
389 389
390 ceil(receiver) { 390 ceil(receiver) {
391 if (receiver is !num) return UNINTERCEPTED(receiver.ceil()); 391 if (receiver is !num) return UNINTERCEPTED(receiver.ceil());
392 392
393 return JS('num', @'Math.ceil(#)', receiver); 393 return JS('num', @'Math.ceil(#)', receiver);
394 } 394 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 if (receiver is !int) return UNINTERCEPTED(receiver.isEven()); 635 if (receiver is !int) return UNINTERCEPTED(receiver.isEven());
636 return (receiver & 1) === 0; 636 return (receiver & 1) === 0;
637 } 637 }
638 638
639 isOdd(receiver) { 639 isOdd(receiver) {
640 if (receiver is !int) return UNINTERCEPTED(receiver.isOdd()); 640 if (receiver is !int) return UNINTERCEPTED(receiver.isOdd());
641 return (receiver & 1) === 1; 641 return (receiver & 1) === 1;
642 } 642 }
643 643
644 get$toString(receiver) => () => toString(receiver); 644 get$toString(receiver) => () => toString(receiver);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698