| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
| 9 * compiled. | 9 * compiled. |
| 10 */ | 10 */ |
| (...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 unimplemented('Compiler.legDirectory'); | 953 unimplemented('Compiler.legDirectory'); |
| 954 } | 954 } |
| 955 | 955 |
| 956 // TODO(karlklose): split into findHelperFunction and findHelperClass and | 956 // TODO(karlklose): split into findHelperFunction and findHelperClass and |
| 957 // add a check that the element has the expected kind. | 957 // add a check that the element has the expected kind. |
| 958 Element findHelper(SourceString name) | 958 Element findHelper(SourceString name) |
| 959 => jsHelperLibrary.findLocal(name); | 959 => jsHelperLibrary.findLocal(name); |
| 960 Element findInterceptor(SourceString name) | 960 Element findInterceptor(SourceString name) |
| 961 => interceptorsLibrary.findLocal(name); | 961 => interceptorsLibrary.findLocal(name); |
| 962 | 962 |
| 963 Element lookupElementIn(ScopeContainerElement container, SourceString name) { |
| 964 Element element = container.localLookup(name); |
| 965 if (element == null) { |
| 966 throw 'Could not find ${name.slowToString()} in $container'; |
| 967 } |
| 968 return element; |
| 969 } |
| 970 |
| 963 bool get isMockCompilation => false; | 971 bool get isMockCompilation => false; |
| 964 | 972 |
| 965 Token processAndStripComments(Token currentToken) { | 973 Token processAndStripComments(Token currentToken) { |
| 966 Token firstToken = currentToken; | 974 Token firstToken = currentToken; |
| 967 Token prevToken; | 975 Token prevToken; |
| 968 while (currentToken.kind != EOF_TOKEN) { | 976 while (currentToken.kind != EOF_TOKEN) { |
| 969 if (identical(currentToken.kind, COMMENT_TOKEN)) { | 977 if (identical(currentToken.kind, COMMENT_TOKEN)) { |
| 970 Token firstCommentToken = currentToken; | 978 Token firstCommentToken = currentToken; |
| 971 while (identical(currentToken.kind, COMMENT_TOKEN)) { | 979 while (identical(currentToken.kind, COMMENT_TOKEN)) { |
| 972 currentToken = currentToken.next; | 980 currentToken = currentToken.next; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 1080 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
| 1073 // information on assertion errors. | 1081 // information on assertion errors. |
| 1074 if (condition is Function){ | 1082 if (condition is Function){ |
| 1075 condition = condition(); | 1083 condition = condition(); |
| 1076 } | 1084 } |
| 1077 if (spannable == null || !condition) { | 1085 if (spannable == null || !condition) { |
| 1078 throw new SpannableAssertionFailure(spannable, message); | 1086 throw new SpannableAssertionFailure(spannable, message); |
| 1079 } | 1087 } |
| 1080 return true; | 1088 return true; |
| 1081 } | 1089 } |
| OLD | NEW |