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

Unified Diff: dart/frog/leg/universe.dart

Issue 9283031: Build script tags. (Closed) Base URL: ssh://aaricia.aar/home/ahe/Dart/all/dart.googlecode.com.git@script
Patch Set: Address review comments Created 8 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/frog/leg/scanner/scanner_task.dart ('k') | dart/frog/tests/leg/src/TypeCheckerTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/universe.dart
diff --git a/dart/frog/leg/universe.dart b/dart/frog/leg/universe.dart
index b1176ab9c8ab4c6076f6d61cf1ec892539386963..1e05243bab80ed286d2c2079d9231f31e9301883 100644
--- a/dart/frog/leg/universe.dart
+++ b/dart/frog/leg/universe.dart
@@ -27,9 +27,12 @@ class Universe {
return elements[name];
}
- void define(Element element) {
- assert(elements[element.name] == null);
- elements[element.name] = element;
+ void define(Element element, Compiler compiler) {
+ Element existing = elements.putIfAbsent(element.name, () => element);
+ if (existing !== element) {
+ compiler.cancel('duplicate definition', token: element.position());
+ compiler.cancel('existing definition', token: existing.position());
+ }
}
void addGeneratedCode(WorkItem work, String code) {
« no previous file with comments | « dart/frog/leg/scanner/scanner_task.dart ('k') | dart/frog/tests/leg/src/TypeCheckerTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698