| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // two libraries during patching. | 377 // two libraries during patching. |
| 378 importHelperLibrary(coreLibrary); | 378 importHelperLibrary(coreLibrary); |
| 379 importHelperLibrary(coreImplLibrary); | 379 importHelperLibrary(coreImplLibrary); |
| 380 importHelperLibrary(interceptorsLibrary); | 380 importHelperLibrary(interceptorsLibrary); |
| 381 | 381 |
| 382 addForeignFunctions(jsHelperLibrary); | 382 addForeignFunctions(jsHelperLibrary); |
| 383 addForeignFunctions(interceptorsLibrary); | 383 addForeignFunctions(interceptorsLibrary); |
| 384 | 384 |
| 385 assertMethod = jsHelperLibrary.find(const SourceString('assert')); | 385 assertMethod = jsHelperLibrary.find(const SourceString('assert')); |
| 386 identicalFunction = coreLibrary.find(const SourceString('identical')); | 386 identicalFunction = coreLibrary.find(const SourceString('identical')); |
| 387 functionApplyMethod = |
| 388 jsHelperLibrary.find(const SourceString('applyFunction')); |
| 387 | 389 |
| 388 initializeSpecialClasses(); | 390 initializeSpecialClasses(); |
| 389 | |
| 390 functionClass.ensureResolved(this); | |
| 391 functionApplyMethod = | |
| 392 functionClass.lookupLocalMember(const SourceString('apply')); | |
| 393 } | 391 } |
| 394 | 392 |
| 395 void loadCoreImplLibrary() { | 393 void loadCoreImplLibrary() { |
| 396 Uri coreImplUri = new Uri.fromComponents(scheme: 'dart', path: 'coreimpl'); | 394 Uri coreImplUri = new Uri.fromComponents(scheme: 'dart', path: 'coreimpl'); |
| 397 coreImplLibrary = scanner.loadLibrary(coreImplUri, null, coreImplUri); | 395 coreImplLibrary = scanner.loadLibrary(coreImplUri, null, coreImplUri); |
| 398 } | 396 } |
| 399 | 397 |
| 400 void importHelperLibrary(LibraryElement library) { | 398 void importHelperLibrary(LibraryElement library) { |
| 401 if (jsHelperLibrary !== null) { | 399 if (jsHelperLibrary !== null) { |
| 402 scanner.importLibrary(library, jsHelperLibrary, null); | 400 scanner.importLibrary(library, jsHelperLibrary, null); |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 * information in the generated error message. | 854 * information in the generated error message. |
| 857 */ | 855 */ |
| 858 bool invariant(Spannable spannable, var condition, {String message: null}) { | 856 bool invariant(Spannable spannable, var condition, {String message: null}) { |
| 859 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 857 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
| 860 // information on assertion errors. | 858 // information on assertion errors. |
| 861 if (condition is Function){ | 859 if (condition is Function){ |
| 862 condition = condition(); | 860 condition = condition(); |
| 863 } | 861 } |
| 864 return spannable != null && condition; | 862 return spannable != null && condition; |
| 865 } | 863 } |
| OLD | NEW |