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

Unified Diff: dart/frog/leg/compile_time_constants.dart

Issue 9421025: Improve double implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dart/frog/leg/lib/js_helper.dart » ('j') | dart/frog/leg/lib/js_helper.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/compile_time_constants.dart
diff --git a/dart/frog/leg/compile_time_constants.dart b/dart/frog/leg/compile_time_constants.dart
index 32234ad532b595ed6350fe4ea3eb4f728b7806c0..1cfc4d7a6fea8722d5dc001654eb6b171b6d33d8 100644
--- a/dart/frog/leg/compile_time_constants.dart
+++ b/dart/frog/leg/compile_time_constants.dart
@@ -161,10 +161,15 @@ class CompileTimeConstantHandler extends CompilerTask {
if (value === null) {
buffer.add("(void 0)");
} else if (value is num) {
- if (value.isNaN()) buffer.add("(0/0)");
- if (value == double.INFINITY) buffer.add("(1/0)");
- if (value == -double.INFINITY) buffer.add("(-1/0)");
- buffer.add("($value)");
+ if (value.isNaN()) {
+ buffer.add("(0/0)");
+ } else if (value == double.INFINITY) {
+ buffer.add("(1/0)");
+ } else if (value == -double.INFINITY) {
+ buffer.add("(-1/0)");
+ } else {
+ buffer.add("($value)");
+ }
} else if (value === true) {
buffer.add("true");
} else if (value === false) {
« no previous file with comments | « no previous file | dart/frog/leg/lib/js_helper.dart » ('j') | dart/frog/leg/lib/js_helper.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698