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

Unified Diff: dart/site/try/compiler_isolate.dart

Issue 132193002: Port Try Dart! to SDK 1.0. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r31735. 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 | « dart/site/try/app.yaml ('k') | dart/site/try/deploy.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/compiler_isolate.dart
diff --git a/dart/site/try/compiler_isolate.dart b/dart/site/try/compiler_isolate.dart
index 362f888963420c1f6d0c5ac78a931009f373f5c2..ae1d669aa47fb04db63188e649f1da7c4b8ff9a3 100644
--- a/dart/site/try/compiler_isolate.dart
+++ b/dart/site/try/compiler_isolate.dart
@@ -7,10 +7,9 @@ library compiler_isolate;
import 'dart:async';
import 'dart:html';
import 'dart:isolate';
-import 'dart:uri';
-import 'dart:json' show parse;
+import 'dart:convert' show JSON;
-import '../sdk/lib/_internal/compiler/compiler.dart' as compiler;
+import '../../sdk/lib/_internal/compiler/compiler.dart' as compiler;
const bool THROW_ON_ERROR = false;
@@ -22,13 +21,16 @@ List options = [];
compile(source, SendPort replyTo) {
if (sdkLocation == null) {
// The first message received gives us the URI of this web app.
- if (source.endsWith('/sdk.dart')) {
+ if (source.endsWith('/sdk.json')) {
var request = new HttpRequest();
request.open('GET', source, async: false);
request.send(null);
+ if (request.status != 200) {
+ throw 'SDK not found at $source';
+ }
sdkLocation = Uri.parse('sdk:/sdk/');
- parse(request.responseText).forEach((file, content) {
- cachedSources[Uri.parse('sdk:/$file')] = content;
+ JSON.decode(request.responseText).forEach((file, content) {
+ cachedSources[Uri.parse(file)] = content;
});
} else {
sdkLocation = Uri.parse(source);
@@ -79,7 +81,7 @@ compile(source, SendPort replyTo) {
throw new Exception('Throw on error');
}
}
- compiler.compile(new Uri('memory:/main.dart'),
+ compiler.compile(Uri.parse('memory:/main.dart'),
sdkLocation,
null,
inputProvider,
« no previous file with comments | « dart/site/try/app.yaml ('k') | dart/site/try/deploy.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698