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

Side by Side Diff: frog/leg/frog_leg.dart

Issue 9535012: Introduce the legium component in test.dart, and start support for dart:dom and dart:html. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/leg/native_handler.dart » ('j') | frog/leg/scanner/scanner_task.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('frog_leg'); 5 #library('frog_leg');
6 6
7 #import('../../lib/uri/uri.dart'); 7 #import('../../lib/uri/uri.dart');
8 #import('../lang.dart', prefix: 'frog'); 8 #import('../lang.dart', prefix: 'frog');
9 #import('elements/elements.dart'); 9 #import('elements/elements.dart');
10 #import('io/io.dart', prefix: 'io'); 10 #import('io/io.dart', prefix: 'io');
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } else { 77 } else {
78 span = spanFromNode(node, current); 78 span = spanFromNode(node, current);
79 } 79 }
80 world.warning('$message.', span); 80 world.warning('$message.', span);
81 } 81 }
82 82
83 reportError(Node node, var message) { 83 reportError(Node node, var message) {
84 cancel(message.toString(), node); 84 cancel(message.toString(), node);
85 } 85 }
86 86
87 Uri getUriOf(String fileName) {
kasperl 2012/03/01 06:30:15 I would call this getUriFor because the file name
ngeoffray 2012/03/01 08:57:57 Done.
88 Uri cwd = new Uri(scheme: 'file', path: currentDirectory);
89 return cwd.resolve(fileName);
90 }
91
87 Script readScript(Uri uri, [ScriptTag node]) { 92 Script readScript(Uri uri, [ScriptTag node]) {
93 String uriName = uri.toString();
94 if (uriName == 'dart:dom') {
ahe 2012/02/29 17:35:27 Please add: // TODO(ahe): Clean this up.
ngeoffray 2012/03/01 08:57:57 Done.
95 uri = getUriOf(io.join([legDirectory, '..', '..',
96 'client', 'dom', 'frog', 'dom_frog.dart']));
97 } else if (uriName == 'dart:html') {
98 uri = getUriOf(io.join([legDirectory, '..', '..',
99 'client', 'html', 'frog', 'html_frog.dart']));
100 }
88 if (uri.scheme != 'file') cancel('cannot read $uri', node: node); 101 if (uri.scheme != 'file') cancel('cannot read $uri', node: node);
89 String text = ""; 102 String text = "";
90 try { 103 try {
91 text = frog.world.files.readAll(uri.path); 104 text = frog.world.files.readAll(uri.path);
92 } catch (var exception) { 105 } catch (var exception) {
93 cancel("${uri.path}: $exception", node: node); 106 cancel("${uri.path}: $exception", node: node);
94 } 107 }
95 world.dartBytesRead += text.length; 108 world.dartBytesRead += text.length;
96 frog.SourceFile sourceFile = new frog.SourceFile(uri.toString(), text); 109 frog.SourceFile sourceFile = new frog.SourceFile(uri.toString(), text);
97 return new Script(uri, sourceFile); 110 return new Script(uri, sourceFile);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 144 }
132 super.cancel(reason, node, token, instruction); 145 super.cancel(reason, node, token, instruction);
133 } 146 }
134 } 147 }
135 148
136 class AbortLeg { 149 class AbortLeg {
137 final message; 150 final message;
138 AbortLeg(this.message); 151 AbortLeg(this.message);
139 toString() => 'Aborted due to --throw-on-error: $message'; 152 toString() => 'Aborted due to --throw-on-error: $message';
140 } 153 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/native_handler.dart » ('j') | frog/leg/scanner/scanner_task.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698