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

Unified Diff: frog/world.dart

Issue 8681027: Fix bug 578 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: prereviewed Created 9 years, 1 month 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 | « frog/type.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/world.dart
diff --git a/frog/world.dart b/frog/world.dart
index 20e4758521936ad0a1b9d4757433e31580c796d2..83712173499a76ab2f5d405a774eeea2e9043ead 100644
--- a/frog/world.dart
+++ b/frog/world.dart
@@ -75,7 +75,7 @@ class World {
List<Library> _todo;
/** Internal map to track name conflicts in the generated javascript. */
- Map<String, Named> _topNames;
+ Map<String, Element> _topNames;
Map<String, MemberSet> _members;
@@ -159,31 +159,31 @@ class World {
}
}
- _addTopName(Named named) {
- var existing = _topNames[named.name];
+ _addTopName(Element named) {
+ var existing = _topNames[named.jsname];
if (existing != null) {
- info('mangling matching top level name "${named.name}" in '
- + 'both "${named.library.name}" and "${existing.library.name}"');
+ info('mangling matching top level name "${named.jsname}" in '
+ + 'both "${named.library.jsname}" and "${existing.library.jsname}"');
if (named.isNative) {
// resolve conflicts in favor first of natives
if (existing.isNative) {
- world.internalError('conflicting native names "${named.name}" '
+ world.internalError('conflicting native names "${named.jsname}" '
+ '(already defined in ${existing.span.locationText})',
named.span);
} else {
- _topNames[named.name] = named;
+ _topNames[named.jsname] = named;
_addJavascriptTopName(existing);
}
} else if (named.library.isCore) {
// then in favor of corelib
if (existing.library.isCore) {
world.internalError(
- 'conflicting top-level names in core "${named.name}" '
+ 'conflicting top-level names in core "${named.jsname}" '
+ '(previously defined in ${existing.span.locationText})',
named.span);
} else {
- _topNames[named.name] = named;
+ _topNames[named.jsname] = named;
_addJavascriptTopName(existing);
}
} else {
@@ -191,12 +191,12 @@ class World {
_addJavascriptTopName(named);
}
} else {
- _topNames[named.name] = named;
+ _topNames[named.jsname] = named;
}
}
- _addJavascriptTopName(Named named) {
- named.jsname = '${named.library.jsname}_${named.name}';
+ _addJavascriptTopName(Element named) {
+ named._jsname = '${named.library.jsname}_${named.jsname}';
final existing = _topNames[named.jsname];
if (existing != null && existing != named) {
world.internalError('name mangling failed for "${named.jsname}" '
« no previous file with comments | « frog/type.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698