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

Side by Side Diff: dart/frog/tests/leg/src/mock_compiler.dart

Issue 9838038: "Implement" #resource tag and various restrictions on library definitions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add #import tags. 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
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('mock_compiler'); 5 #library('mock_compiler');
6 6
7 #import("../../../../lib/uri/uri.dart"); 7 #import("../../../../lib/uri/uri.dart");
8 8
9 #import("../../../leg/elements/elements.dart"); 9 #import("../../../leg/elements/elements.dart");
10 #import("../../../leg/io/io.dart", prefix: 'io'); 10 #import("../../../leg/io/io.dart", prefix: 'io');
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 scanner.importLibrary(jsHelperLibrary, coreLibrary, null); 68 scanner.importLibrary(jsHelperLibrary, coreLibrary, null);
69 mainApp = mockLibrary(this, ""); 69 mainApp = mockLibrary(this, "");
70 initializeSpecialClasses(); 70 initializeSpecialClasses();
71 } 71 }
72 72
73 void reportWarning(Node node, var message) { 73 void reportWarning(Node node, var message) {
74 warnings.add(new WarningMessage(node, message.message)); 74 warnings.add(new WarningMessage(node, message.message));
75 } 75 }
76 76
77 void reportError(Node node, var message) { 77 void reportError(Node node, var message) {
78 if (message is String && message.startsWith("no #library tag found in")) {
79 // TODO(ahe): Fix the MockCompiler to not have this problem.
80 return;
81 }
78 errors.add(new WarningMessage(node, message.message)); 82 errors.add(new WarningMessage(node, message.message));
79 } 83 }
80 84
81 void reportDiagnostic(SourceSpan span, String message, bool fatal) { 85 void reportDiagnostic(SourceSpan span, String message, bool fatal) {
82 print(message); 86 print(message);
83 } 87 }
84 88
85 void clearWarnings() { 89 void clearWarnings() {
86 warnings = []; 90 warnings = [];
87 } 91 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 importLibrary(library, compiler.coreLibrary, compiler); 187 importLibrary(library, compiler.coreLibrary, compiler);
184 return library; 188 return library;
185 } 189 }
186 190
187 class StringScript extends Script { 191 class StringScript extends Script {
188 final String code; 192 final String code;
189 StringScript(this.code) : super(null, null); 193 StringScript(this.code) : super(null, null);
190 String get text() => code; 194 String get text() => code;
191 String get name() => "mock script"; 195 String get name() => "mock script";
192 } 196 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698