OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** The one true [World]. */ | 5 /** The one true [World]. */ |
6 World world; | 6 World world; |
7 | 7 |
8 /** | 8 /** |
9 * Experimental phase to enable await, only set when using the | 9 * Experimental phase to enable await, only set when using the |
10 * await/awaitc.dart entrypoint. | 10 * await/awaitc.dart entrypoint. |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 // wins. | 294 // wins. |
295 _renameJavascriptTopName(named); | 295 _renameJavascriptTopName(named); |
296 } else if (namedPri > existingPri) { | 296 } else if (namedPri > existingPri) { |
297 // New one takes priority over existing | 297 // New one takes priority over existing |
298 _renameJavascriptTopName(existing); | 298 _renameJavascriptTopName(existing); |
299 } else { | 299 } else { |
300 if (named.isNative) { | 300 if (named.isNative) { |
301 final msg = 'conflicting JS name "$name" of same ' | 301 final msg = 'conflicting JS name "$name" of same ' |
302 + 'priority $existingPri: (already defined in) ' | 302 + 'priority $existingPri: (already defined in) ' |
303 + '${existing.span.locationText} with priority $namedPri)'; | 303 + '${existing.span.locationText} with priority $namedPri)'; |
304 // We trust that conflicting native names in builtin libraries are | 304 // We trust that conflicting native names in builtin libraries |
305 // harmless. Most cases there are no conflicts, currently isolates | 305 // are harmless. Most cases there are no conflicts, currently |
306 // in coreimpl and dart:dom both define web workers to avoid adding a | 306 // isolates in coreimpl and dart:dom_deprecated both define |
307 // dependency from corelib to dart:dom. | 307 // web workers to avoid adding a dependency from corelib to |
| 308 // dart:dom_deprecated. |
308 world.info(msg, named.span, existing.span); | 309 world.info(msg, named.span, existing.span); |
309 } else { | 310 } else { |
310 // Conflicting js name in same library. This happens because | 311 // Conflicting js name in same library. This happens because |
311 // of two different type arguments with the same name but in | 312 // of two different type arguments with the same name but in |
312 // different libraries. | 313 // different libraries. |
313 _renameJavascriptTopName(existing); | 314 _renameJavascriptTopName(existing); |
314 } | 315 } |
315 } | 316 } |
316 } | 317 } |
317 | 318 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 if (library == null) { | 465 if (library == null) { |
465 library = new Library(readFile(filename)); | 466 library = new Library(readFile(filename)); |
466 info('read library ${filename}'); | 467 info('read library ${filename}'); |
467 if (!library.isCore && | 468 if (!library.isCore && |
468 !library.imports.some((li) => li.library.isCore)) { | 469 !library.imports.some((li) => li.library.isCore)) { |
469 library.imports.add(new LibraryImport(corelib)); | 470 library.imports.add(new LibraryImport(corelib)); |
470 } | 471 } |
471 libraries[filename] = library; | 472 libraries[filename] = library; |
472 _todo.add(library); | 473 _todo.add(library); |
473 | 474 |
474 if (filename == 'dart:dom') { | 475 if (filename == 'dart:dom_deprecated') { |
475 dom = library; | 476 dom = library; |
476 } else if (filename == 'dart:html') { | 477 } else if (filename == 'dart:html') { |
477 html = library; | 478 html = library; |
478 } else if (filename == 'dart:isolate') { | 479 } else if (filename == 'dart:isolate') { |
479 isolatelib = library; | 480 isolatelib = library; |
480 } | 481 } |
481 } | 482 } |
482 return library; | 483 return library; |
483 } | 484 } |
484 | 485 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 | 703 |
703 withTiming(String name, f()) { | 704 withTiming(String name, f()) { |
704 final sw = new Stopwatch(); | 705 final sw = new Stopwatch(); |
705 sw.start(); | 706 sw.start(); |
706 var result = f(); | 707 var result = f(); |
707 sw.stop(); | 708 sw.stop(); |
708 info('$name in ${sw.elapsedInMs()}msec'); | 709 info('$name in ${sw.elapsedInMs()}msec'); |
709 return result; | 710 return result; |
710 } | 711 } |
711 } | 712 } |
OLD | NEW |