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

Unified Diff: pkg/json/test/json_test.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 | « pkg/json/lib/json.dart ('k') | sdk/lib/convert/json.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/json/test/json_test.dart
diff --git a/pkg/json/test/json_test.dart b/pkg/json/test/json_test.dart
index d146ce38de9e337daa6c3ccec7d4dad06684d039..c3aaf7028b89d3d1bd81a2c10efd17bf1def1580 100644
--- a/pkg/json/test/json_test.dart
+++ b/pkg/json/test/json_test.dart
@@ -123,6 +123,17 @@ main() {
json.stringify([new Object()]);
}, throwsJsonError);
+ expect(() {
+ json.stringify([double.NAN]);
+ }, throwsJsonError);
+
+ expect(() {
+ json.stringify([double.INFINITY]);
+ }, throwsJsonError);
+
+ expect(() {
+ json.stringify([-double.INFINITY]);
+ }, throwsJsonError);
});
test('stringify throws if argument cannot be converted', () {
« no previous file with comments | « pkg/json/lib/json.dart ('k') | sdk/lib/convert/json.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698