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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/deferred_load.dart

Issue 20742002: Clean up error handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added documentation guide lines. Created 7 years, 4 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 deferred_load; 5 library deferred_load;
6 6
7 import 'dart:collection' 7 import 'dart:collection'
8 show LinkedHashMap, 8 show LinkedHashMap,
9 LinkedHashSet; 9 LinkedHashSet;
10 10
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 Element element = metadata.value.computeType(compiler).element; 201 Element element = metadata.value.computeType(compiler).element;
202 if (element == deferredLibraryClass) { 202 if (element == deferredLibraryClass) {
203 ConstructedConstant value = metadata.value; 203 ConstructedConstant value = metadata.value;
204 StringConstant nameField = value.fields[0]; 204 StringConstant nameField = value.fields[0];
205 SourceString expectedName = nameField.toDartString().source; 205 SourceString expectedName = nameField.toDartString().source;
206 LibraryElement deferredLibrary = library.getLibraryFromTag(tag); 206 LibraryElement deferredLibrary = library.getLibraryFromTag(tag);
207 link = link.prepend(deferredLibrary); 207 link = link.prepend(deferredLibrary);
208 SourceString actualName = 208 SourceString actualName =
209 new SourceString(deferredLibrary.getLibraryOrScriptName()); 209 new SourceString(deferredLibrary.getLibraryOrScriptName());
210 if (expectedName != actualName) { 210 if (expectedName != actualName) {
211 compiler.reportErrorCode( 211 compiler.reportError(
212 metadata, 212 metadata,
213 MessageKind.DEFERRED_LIBRARY_NAME_MISMATCH, 213 MessageKind.DEFERRED_LIBRARY_NAME_MISMATCH,
214 { 'expectedName': expectedName.slowToString(), 214 { 'expectedName': expectedName.slowToString(),
215 'actualName': actualName.slowToString()}); 215 'actualName': actualName.slowToString()});
216 } 216 }
217 } 217 }
218 } 218 }
219 } 219 }
220 return link; 220 return link;
221 } 221 }
(...skipping 18 matching lines...) Expand all
240 compiler.enqueuer.resolution.getCachedElements(element); 240 compiler.enqueuer.resolution.getCachedElements(element);
241 if (elements == null) return new LinkedHashSet<Element>(); 241 if (elements == null) return new LinkedHashSet<Element>();
242 Node node = element.parseNode(compiler); 242 Node node = element.parseNode(compiler);
243 if (node == null) return new LinkedHashSet<Element>(); 243 if (node == null) return new LinkedHashSet<Element>();
244 var collector = new DependencyCollector(elements, compiler); 244 var collector = new DependencyCollector(elements, compiler);
245 node.accept(collector); 245 node.accept(collector);
246 collector.dependencies.addAll(elements.otherDependencies); 246 collector.dependencies.addAll(elements.otherDependencies);
247 return collector.dependencies; 247 return collector.dependencies;
248 } 248 }
249 } 249 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698