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

Side by Side Diff: frog/leg/lib/js_helper.dart

Issue 9677039: toStringAsExponential allows the fractionDigits argument to be null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | « no previous file | tests/co19/co19-leg.status » ('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 #library('js_helper'); 5 #library('js_helper');
6 6
7 #import('coreimpl.dart'); 7 #import('coreimpl.dart');
8 8
9 #source('constant_map.dart'); 9 #source('constant_map.dart');
10 #source('date_helper.dart'); 10 #source('date_helper.dart');
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 String result = JS('String', @'$0.toFixed($1)', receiver, fractionDigits); 961 String result = JS('String', @'$0.toFixed($1)', receiver, fractionDigits);
962 if (receiver == 0 && receiver.isNegative()) return "-$result"; 962 if (receiver == 0 && receiver.isNegative()) return "-$result";
963 return result; 963 return result;
964 } 964 }
965 965
966 builtin$toStringAsExponential$1(receiver, fractionDigits) { 966 builtin$toStringAsExponential$1(receiver, fractionDigits) {
967 checkNull(receiver); 967 checkNull(receiver);
968 if (receiver is !num) { 968 if (receiver is !num) {
969 return UNINTERCEPTED(receiver.toStringAsExponential(fractionDigits)); 969 return UNINTERCEPTED(receiver.toStringAsExponential(fractionDigits));
970 } 970 }
971 checkNum(fractionDigits); 971 if (fractionDigits !== null) checkNum(fractionDigits);
972 972
973 String result = JS('String', @'$0.toExponential($1)', 973 String result = JS('String', @'$0.toExponential($1)',
974 receiver, fractionDigits); 974 receiver, fractionDigits);
975 if (receiver == 0 && receiver.isNegative()) return "-$result"; 975 if (receiver == 0 && receiver.isNegative()) return "-$result";
976 return result; 976 return result;
977 } 977 }
978 978
979 builtin$toStringAsPrecision$1(receiver, fractionDigits) { 979 builtin$toStringAsPrecision$1(receiver, fractionDigits) {
980 checkNull(receiver); 980 checkNull(receiver);
981 if (receiver is !num) { 981 if (receiver is !num) {
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 // Called at the end of unaborted switch cases to get the (unique) 1398 // Called at the end of unaborted switch cases to get the (unique)
1399 // FallThroughError exception that will be thrown. 1399 // FallThroughError exception that will be thrown.
1400 FallThroughError fallThroughErrorInstance = null; 1400 FallThroughError fallThroughErrorInstance = null;
1401 getFallThroughError() { 1401 getFallThroughError() {
1402 // TODO(lrn): Redo when we support "const FallThroughError()". 1402 // TODO(lrn): Redo when we support "const FallThroughError()".
1403 if (fallThroughErrorInstance === null) { 1403 if (fallThroughErrorInstance === null) {
1404 fallThroughErrorInstance = new FallThroughError(); 1404 fallThroughErrorInstance = new FallThroughError();
1405 } 1405 }
1406 return fallThroughErrorInstance; 1406 return fallThroughErrorInstance;
1407 } 1407 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698