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

Unified Diff: pkg/json/lib/json.dart

Issue 136373002: Fix JSON encoder accepting NaN and Infinity. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 | pkg/json/test/json_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/json/lib/json.dart
diff --git a/pkg/json/lib/json.dart b/pkg/json/lib/json.dart
index f7063382c6ddb05aa8a4ec6cfa7da1c985a8d960..4c6732275c515dae62587880cc3877274003a195 100644
--- a/pkg/json/lib/json.dart
+++ b/pkg/json/lib/json.dart
@@ -769,7 +769,7 @@ class _JsonStringifier {
*/
bool stringifyJsonValue(final object) {
if (object is num) {
- // TODO: use writeOn.
+ if (!object.isFinite) return false;
sink.write(numberToString(object));
return true;
} else if (identical(object, true)) {
« no previous file with comments | « no previous file | pkg/json/test/json_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698