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 const bool REPORT_EXCESS_RESOLUTION = false; | 10 const bool REPORT_EXCESS_RESOLUTION = false; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 coreImplLibrary = scanBuiltinLibrary('coreimpl'); | 356 coreImplLibrary = scanBuiltinLibrary('coreimpl'); |
357 jsHelperLibrary = scanBuiltinLibrary('_js_helper'); | 357 jsHelperLibrary = scanBuiltinLibrary('_js_helper'); |
358 interceptorsLibrary = scanBuiltinLibrary('_interceptors'); | 358 interceptorsLibrary = scanBuiltinLibrary('_interceptors'); |
359 | 359 |
360 addForeignFunctions(jsHelperLibrary); | 360 addForeignFunctions(jsHelperLibrary); |
361 addForeignFunctions(interceptorsLibrary); | 361 addForeignFunctions(interceptorsLibrary); |
362 | 362 |
363 libraries['dart:core'] = coreLibrary; | 363 libraries['dart:core'] = coreLibrary; |
364 libraries['dart:coreimpl'] = coreImplLibrary; | 364 libraries['dart:coreimpl'] = coreImplLibrary; |
365 | 365 |
366 assertMethod = coreLibrary.find(const SourceString('assert')); | 366 assertMethod = jsHelperLibrary.find(const SourceString('assert')); |
367 | 367 |
368 initializeSpecialClasses(); | 368 initializeSpecialClasses(); |
369 } | 369 } |
370 | 370 |
371 void importCoreLibrary(LibraryElement library) { | 371 void importCoreLibrary(LibraryElement library) { |
372 Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core'); | 372 Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core'); |
373 if (coreLibrary === null) { | 373 if (coreLibrary === null) { |
374 coreLibrary = scanner.loadLibrary(coreUri, null, coreUri); | 374 coreLibrary = scanner.loadLibrary(coreUri, null, coreUri); |
375 } | 375 } |
376 scanner.importLibrary(library, | 376 scanner.importLibrary(library, |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 final endOffset = end.charOffset + end.slowCharCount; | 926 final endOffset = end.charOffset + end.slowCharCount; |
927 | 927 |
928 // [begin] and [end] might be the same for the same empty token. This | 928 // [begin] and [end] might be the same for the same empty token. This |
929 // happens for instance when scanning '$$'. | 929 // happens for instance when scanning '$$'. |
930 assert(endOffset >= beginOffset); | 930 assert(endOffset >= beginOffset); |
931 return f(beginOffset, endOffset); | 931 return f(beginOffset, endOffset); |
932 } | 932 } |
933 | 933 |
934 String toString() => 'SourceSpan($uri, $begin, $end)'; | 934 String toString() => 'SourceSpan($uri, $begin, $end)'; |
935 } | 935 } |
OLD | NEW |