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

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: 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
Index: dart/frog/leg/universe.dart
diff --git a/dart/frog/leg/universe.dart b/dart/frog/leg/universe.dart
index b1176ab9c8ab4c6076f6d61cf1ec892539386963..dc64a7376af13840799ade2d071dbf0f335236f0 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);
ngeoffray 2012/01/25 09:04:59 spaces around => ?
ahe 2012/01/25 09:28:53 Done.
+ if (existing !== element) {
+ compiler.cancel('duplicate definition', token: element.position());
+ compiler.cancel('existing definition', token: existing.position());
+ }
}
void addGeneratedCode(WorkItem work, String code) {

Powered by Google App Engine
This is Rietveld 408576698