Procházet zdrojové kódy

Updated to the latest Dart SDK version.

Lucian Pacurar před 12 roky
rodič
revize
8c743dfc3c
3 změnil soubory, kde provedl 12 přidání a 13 odebrání
  1. 5 5
      dart/README.md
  2. 4 4
      dart/pubspec.yaml
  3. 3 4
      dart/server.dart

+ 5 - 5
dart/README.md

@@ -4,12 +4,12 @@ This is the dart portion of a [benchmarking test suite](../) comparing a variety
 
 ## Versions
 
-* [Dart SDK version 0.5.13.1_r23552](http://www.dartlang.org/)
-* [Dart args version 0.5.9](http://pub.dartlang.org/packages/args)
-* [Dart crypto version 0.5.13](http://pub.dartlang.org/packages/crypto)
+* [Dart SDK version 0.8.7.0_r29341](http://www.dartlang.org/)
+* [Dart args version 0.8.7](http://pub.dartlang.org/packages/args)
+* [Dart crypto version 0.8.7](http://pub.dartlang.org/packages/crypto)
 * [Dart mustache version 0.1.5](http://pub.dartlang.org/packages/mustache)
-* [Dart postgresql version 0.2.7](http://pub.dartlang.org/packages/postgresql)
-* [Dart yaml version 0.5.7](http://pub.dartlang.org/packages/yaml)
+* [Dart postgresql version 0.2.9](http://pub.dartlang.org/packages/postgresql)
+* [Dart yaml version 0.8.7](http://pub.dartlang.org/packages/yaml)
 
 ## Test URLs
 

+ 4 - 4
dart/pubspec.yaml

@@ -1,8 +1,8 @@
 name: dartbenchmark
 description: A benchmark of dart
 dependencies:
-  args: 0.5.9
-  crypto: 0.5.13
+  args: 0.8.7
+  crypto: 0.8.7
   mustache: 0.1.5
-  postgresql: 0.2.7
-  yaml: 0.5.7
+  postgresql: 0.2.9
+  yaml: 0.8.7

+ 3 - 4
dart/server.dart

@@ -1,7 +1,6 @@
 import 'dart:async' show Future;
 import 'dart:io';
-import 'dart:utf';
-import 'dart:json' as json;
+import 'dart:convert';
 import 'dart:math' show Random;
 import 'package:args/args.dart' show ArgParser;
 import 'package:mustache/mustache.dart' as mustache;
@@ -135,7 +134,7 @@ _sendResponse(request, statusCode, [ type, response ]) {
     request.response.headers.contentType = type;
   }
   if (response != null) {
-    var data = encodeUtf8(response);
+    var data = UTF8.encode(response);
     request.response.contentLength = data.length;
     request.response.add(data);
   } else {
@@ -151,7 +150,7 @@ _sendHtml(request, response) {
 
 /// Completes the given [request] by writing the [response] as JSON.
 _sendJson(request, response) {
-  _sendResponse(request, HttpStatus.OK, _TYPE_JSON, json.stringify(response));
+  _sendResponse(request, HttpStatus.OK, _TYPE_JSON, JSON.encode(response));
 }
 
 /// Completes the given [request] by writing the [response] as plain text.