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

Unified Diff: samples/newissues/newissues.dart

Issue 10908066: - Removed named constructor Stopwatch.start() due to conflict with instance methods start(). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
Index: samples/newissues/newissues.dart
===================================================================
--- samples/newissues/newissues.dart (revision 11786)
+++ samples/newissues/newissues.dart (working copy)
@@ -5,9 +5,7 @@
#import('dart:html');
#import('dart:json');
-/**
- * Issue wraps JSON structure that describes a bug.
- */
+/// Issue wraps JSON structure that describes a bug.
class Issue {
final json;
Issue(this.json);
@@ -18,18 +16,14 @@
}
}
-/**
- * Decodes JSON into a list of Issues.
- */
+/// Decodes JSON into a list of Issues.
List<Issue> getIssues(json) {
var issues = json["feed"]["entry"];
if (issues == null) return null;
return issues.map((data) => new Issue(data));
}
-/**
- * Iterates over the recieved issues and construct HTML for them.
- */
+/// Iterates over the recieved issues and construct HTML for them.
void processJson(json) {
Element div = query("#content");
List<Issue> list = getIssues(json);
@@ -40,9 +34,7 @@
}
}
-/**
- * Sends a HTTPRequest and returns a future fo the date.
- */
+/// Sends a HTTPRequest and returns a future fo the date.
Future<Dynamic> requestJson(String url) {
Completer c = new Completer<Dynamic>();
void callback(HttpRequest req) {
@@ -55,8 +47,8 @@
}
void main() {
- // Requests new issues (can=new) from the Dart issue database.
- final String url =
- "https://code.google.com/feeds/issues/p/dart/issues/full?alt=json&can=new";
- requestJson(url).then(processJson);
+ // Requests new issues from the Dart issue database as json.
+ const String url = "https://code.google.com/feeds/issues/p/dart/issues/full";
+ const String options = "alt=json&can=new";
+ requestJson("$url?$options").then(processJson);
}

Powered by Google App Engine
This is Rietveld 408576698