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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_number.dart

Issue 11348133: Add JSNull, JSBool and JSFunction, and move toString into the new interceptor scheme. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
Index: sdk/lib/_internal/compiler/implementation/lib/js_number.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/lib/js_number.dart (revision 15139)
+++ sdk/lib/_internal/compiler/implementation/lib/js_number.dart (working copy)
@@ -109,6 +109,14 @@
if (radix < 2 || radix > 36) throw new ArgumentError(radix);
return JS('String', r'#.toString(#)', this, radix);
}
+
+ String toString() {
+ if (this == 0 && JS('bool', '(1 / #) < 0', this)) {
+ return '-0.0';
+ } else {
+ return JS('String', r'String(#)', this);
+ }
+ }
}
class JSInt extends JSNumber {

Powered by Google App Engine
This is Rietveld 408576698