Browse Source

Updated to the latest Dart SDK.

Lucian Pacurar 11 years ago
parent
commit
05f51cfcc6
2 changed files with 14 additions and 12 deletions
  1. 7 5
      dart-start/pubspec.yaml
  2. 7 7
      dart-start/server.dart

+ 7 - 5
dart-start/pubspec.yaml

@@ -1,10 +1,12 @@
 name: DartStartBenchmark
 name: DartStartBenchmark
 description: A benchmark of Dart Start, a Sinatra inspired web framework
 description: A benchmark of Dart Start, a Sinatra inspired web framework
+environment:
+  sdk: ">=0.8.7"
 dependencies:
 dependencies:
-  args: 0.8.5
-  crypto: 0.8.5
+  args: 0.8.7
+  crypto: 0.8.7
   mongo_dart: 0.1.31
   mongo_dart: 0.1.31
   mustache: 0.1.5
   mustache: 0.1.5
-  postgresql: 0.2.8
-  start: 0.0.9+1
-  yaml: 0.8.5
+  postgresql: 0.2.9
+  start: 0.0.9+2
+  yaml: 0.8.7

+ 7 - 7
dart-start/server.dart

@@ -1,7 +1,7 @@
 import "dart:core";
 import "dart:core";
 import "dart:io";
 import "dart:io";
 import 'dart:async' show Future;
 import 'dart:async' show Future;
-import 'dart:json' as json;
+import 'dart:convert';
 import 'dart:math' show Random;
 import 'dart:math' show Random;
 import "package:start/start.dart";
 import "package:start/start.dart";
 import "package:args/args.dart";
 import "package:args/args.dart";
@@ -93,7 +93,7 @@ main() {
           };
           };
           
           
           _setJsonHeaders(request.response);
           _setJsonHeaders(request.response);
-          request.response.send(json.stringify(helloWorld));
+          request.response.send(JSON.encode(helloWorld));
         });
         });
         
         
         
         
@@ -103,7 +103,7 @@ main() {
           _setJsonHeaders(request.response);
           _setJsonHeaders(request.response);
           
           
           _query().then((data) {
           _query().then((data) {
-            request.response.send(json.stringify(data));
+            request.response.send(JSON.encode(data));
           });
           });
         });
         });
         
         
@@ -121,7 +121,7 @@ main() {
                   growable: false
                   growable: false
                 )
                 )
             )
             )
-            .then((response) => request.response.send(json.stringify(response)));
+            .then((response) => request.response.send(JSON.encode(response)));
         });
         });
         
         
         // Fortunes test
         // Fortunes test
@@ -170,7 +170,7 @@ main() {
                       .then((_) => world);
                       .then((_) => world);
                 });
                 });
           }, growable: false))
           }, growable: false))
-          .then((worlds) => request.response.send(json.stringify(worlds)));
+          .then((worlds) => request.response.send(JSON.encode(worlds)));
         });
         });
         
         
         // Plain text test
         // Plain text test
@@ -251,7 +251,7 @@ main() {
                   "randomnumber": world["randomnumber"]
                   "randomnumber": world["randomnumber"]
                 };
                 };
               });
               });
-              request.response.send(json.stringify(results.toList()));
+              request.response.send(JSON.encode(results.toList()));
             });
             });
         });
         });
         
         
@@ -276,7 +276,7 @@ main() {
                 "randomnumber": world["randomnumber"]
                 "randomnumber": world["randomnumber"]
               };
               };
             });
             });
-            request.response.send(json.stringify(result.toList()));
+            request.response.send(JSON.encode(result.toList()));
           });
           });
         });
         });