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

Unified Diff: frog/world.dart

Issue 8999030: frog isolate fixes: minor changes to the isolate library + architecture.py (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 9 years 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: frog/world.dart
diff --git a/frog/world.dart b/frog/world.dart
index 9b6bcfe43307d8c66b52c31db3670434b3c430a5..7f4b2e44707b8ff2b4cd6695cd9f3babc6413e58 100644
--- a/frog/world.dart
+++ b/frog/world.dart
@@ -215,9 +215,11 @@ class World {
} else if (namedPri > existingPri) {
// New one takes priority over existing
_renameJavascriptTopName(existing);
- } else {
+ } else if ((!_isDomWorker(named) || !_isIsolateWorker(existing))
+ && (!_isDomWorker(existing) || !_isIsolateWorker(named))) {
// Two conflicting native names or names in corelib. Libraries need
- // to be fixed.
+ // to be fixed. We exclude the case when isolate defines Worker, so that
+ // corelib doesn't depend on the dom lib.
world.internalError('conflicting JS name "$name" of same '
+ 'priority $existingPri: (already defined in) '
+ '${existing.span.locationText} with priority $namedPri)',
@@ -229,6 +231,16 @@ class World {
}
}
+ /** Whether element is the dom definition of Worker. */
+ _isDomWorker(Element e) {
+ return e.library == dom && e.nativeName == 'Worker';
+ }
+
+ /** Whether element is the isolate (corelib) definition of Worker. */
+ _isIsolateWorker(Element e) {
+ return e.library == coreimpl && e.nativeName == 'Worker';
+ }
+
/** Renames an [Element] that had a name conflict in the generated JS. */
_renameJavascriptTopName(Element named) {
named._jsname = '${named.library.jsname}_${named.jsname}';
« no previous file with comments | « frog/minfrog ('k') | tests/isolate/isolate.status » ('j') | tools/testing/architecture.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698