| 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}';
|
|
|