| 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 } | 834 } |
| 835 if (element === null) { | 835 if (element === null) { |
| 836 element = currentElement; | 836 element = currentElement; |
| 837 } | 837 } |
| 838 Token position = element.position(); | 838 Token position = element.position(); |
| 839 Uri uri = element.getCompilationUnit().script.uri; | 839 Uri uri = element.getCompilationUnit().script.uri; |
| 840 | 840 |
| 841 // TODO(ager,johnniwinther): The patch support should be | 841 // TODO(ager,johnniwinther): The patch support should be |
| 842 // reworked to allow us to get rid of this. | 842 // reworked to allow us to get rid of this. |
| 843 if (element.isPatched) { | 843 if (element.isPatched) { |
| 844 position = element.patch.position(); | 844 // TODO(johnniwinther,karlklose): create a subtype of Element for |
| 845 uri = element.patch.getCompilationUnit().script.uri; | 845 // patchable elements or move the patch field to Element. |
| 846 var patched = element; |
| 847 position = patched.patch.position(); |
| 848 uri = patched.patch.getCompilationUnit().script.uri; |
| 846 } | 849 } |
| 847 | 850 |
| 848 return (position === null) | 851 return (position === null) |
| 849 ? new SourceSpan(uri, 0, 0) | 852 ? new SourceSpan(uri, 0, 0) |
| 850 : spanFromTokens(position, position, uri); | 853 : spanFromTokens(position, position, uri); |
| 851 } | 854 } |
| 852 | 855 |
| 853 Script readScript(Uri uri, [ScriptTag node]) { | 856 Script readScript(Uri uri, [ScriptTag node]) { |
| 854 unimplemented('Compiler.readScript'); | 857 unimplemented('Compiler.readScript'); |
| 855 } | 858 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 * information in the generated error message. | 951 * information in the generated error message. |
| 949 */ | 952 */ |
| 950 bool invariant(Spannable spannable, var condition, {String message: null}) { | 953 bool invariant(Spannable spannable, var condition, {String message: null}) { |
| 951 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 954 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
| 952 // information on assertion errors. | 955 // information on assertion errors. |
| 953 if (condition is Function){ | 956 if (condition is Function){ |
| 954 condition = condition(); | 957 condition = condition(); |
| 955 } | 958 } |
| 956 return spannable != null && condition; | 959 return spannable != null && condition; |
| 957 } | 960 } |
| OLD | NEW |