| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js_incremental.library_updater; | 5 library dart2js_incremental.library_updater; |
| 6 | 6 |
| 7 import 'dart:async' show | 7 import 'dart:async' show |
| 8 Future; | 8 Future; |
| 9 | 9 |
| 10 import 'dart:convert' show | 10 import 'dart:convert' show |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 return canReuseRemovedFunction(element); | 226 return canReuseRemovedFunction(element); |
| 227 } | 227 } |
| 228 return cannotReuse( | 228 return cannotReuse( |
| 229 element, "Removed element that isn't a method."); | 229 element, "Removed element that isn't a method."); |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool canReuseRemovedFunction(PartialFunctionElement element) { | 232 bool canReuseRemovedFunction(PartialFunctionElement element) { |
| 233 logVerbose("Removed method $element."); | 233 logVerbose("Removed method $element."); |
| 234 | 234 |
| 235 PartialClassElement cls = element.enclosingClass; | 235 PartialClassElement cls = element.enclosingClass; |
| 236 if (cls != null && !element.isInstanceMember) { | |
| 237 return cannotReuse(element, "Removed static method"); | |
| 238 } | |
| 239 for (ScopeContainerElement scope in scopesAffectedBy(element, cls)) { | 236 for (ScopeContainerElement scope in scopesAffectedBy(element, cls)) { |
| 240 scanSites(scope, (Element member, DeclarationSite site) { | 237 scanSites(scope, (Element member, DeclarationSite site) { |
| 241 // TODO(ahe): Cache qualifiedNamesIn to avoid quadratic behavior. | 238 // TODO(ahe): Cache qualifiedNamesIn to avoid quadratic behavior. |
| 242 Map<String, List<String>> names = qualifiedNamesIn(site); | 239 Map<String, List<String>> names = qualifiedNamesIn(site); |
| 243 if (canNamesResolveTo(names, element, cls)) { | 240 if (canNamesResolveTo(names, element, cls)) { |
| 244 _elementsToInvalidate.add(member); | 241 _elementsToInvalidate.add(member); |
| 245 } | 242 } |
| 246 }); | 243 }); |
| 247 } | 244 } |
| 248 | 245 |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 | 679 |
| 683 abstract class JsFeatures { | 680 abstract class JsFeatures { |
| 684 Compiler get compiler; | 681 Compiler get compiler; |
| 685 | 682 |
| 686 JavaScriptBackend get backend => compiler.backend; | 683 JavaScriptBackend get backend => compiler.backend; |
| 687 | 684 |
| 688 Namer get namer => backend.namer; | 685 Namer get namer => backend.namer; |
| 689 | 686 |
| 690 CodeEmitterTask get emitter => backend.emitter; | 687 CodeEmitterTask get emitter => backend.emitter; |
| 691 } | 688 } |
| OLD | NEW |