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 | 5 |
6 /** | 6 /** |
7 * If true, print a warning for each method that was resolved, but not | 7 * If true, print a warning for each method that was resolved, but not |
8 * compiled. | 8 * compiled. |
9 */ | 9 */ |
10 final bool REPORT_EXCESS_RESOLUTION = false; | 10 final bool REPORT_EXCESS_RESOLUTION = false; |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 assertMethod = coreLibrary.find(const SourceString('assert')); | 369 assertMethod = coreLibrary.find(const SourceString('assert')); |
370 | 370 |
371 initializeSpecialClasses(); | 371 initializeSpecialClasses(); |
372 | 372 |
373 //patchDartLibrary(coreLibrary, 'core'); | 373 //patchDartLibrary(coreLibrary, 'core'); |
374 //patchDartLibrary(coreImplLibrary, 'coreimpl'); | 374 //patchDartLibrary(coreImplLibrary, 'coreimpl'); |
375 } | 375 } |
376 | 376 |
377 void patchDartLibrary(LibraryElement library, String dartLibraryPath) { | 377 void patchDartLibrary(LibraryElement library, String dartLibraryPath) { |
378 print("[Patching; $library ($dartLibraryPath)"); | |
379 if (library.isPatched) return; | 378 if (library.isPatched) return; |
380 Uri patchUri = resolvePatchUri(dartLibraryPath); | 379 Uri patchUri = resolvePatchUri(dartLibraryPath); |
381 if (patchUri !== null) { | 380 if (patchUri !== null) { |
382 print("[... loading patch ...]"); | |
383 patchParser.patchLibrary(patchUri, library); | 381 patchParser.patchLibrary(patchUri, library); |
384 // We allow foreign functions in patched libraries. | 382 // We allow foreign functions in patched libraries. |
385 addForeignFunctions(library); // Is safe even if already added. | 383 addForeignFunctions(library); // Is safe even if already added. |
386 // TODO(lrn): Make this lazy. | 384 // TODO(lrn): Make this lazy. |
387 applyClassPatches(library); | 385 applyClassPatches(library); |
388 } | 386 } |
389 } | 387 } |
390 | 388 |
391 void applyClassPatches(LibraryElement library) { | 389 void applyClassPatches(LibraryElement library) { |
392 for (Element element in library.localMembers) { | 390 for (Element element in library.localMembers) { |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 final endOffset = end.charOffset + end.slowCharCount; | 935 final endOffset = end.charOffset + end.slowCharCount; |
938 | 936 |
939 // [begin] and [end] might be the same for the same empty token. This | 937 // [begin] and [end] might be the same for the same empty token. This |
940 // happens for instance when scanning '$$'. | 938 // happens for instance when scanning '$$'. |
941 assert(endOffset >= beginOffset); | 939 assert(endOffset >= beginOffset); |
942 return f(beginOffset, endOffset); | 940 return f(beginOffset, endOffset); |
943 } | 941 } |
944 | 942 |
945 String toString() => 'SourceSpan($uri, $begin, $end)'; | 943 String toString() => 'SourceSpan($uri, $begin, $end)'; |
946 } | 944 } |
OLD | NEW |