Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Unified Diff: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart

Issue 24519004: Ensure only a subset of elements enter in Compiler.analyzedElement. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (revision 27842)
+++ sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (working copy)
@@ -149,8 +149,15 @@
Constant result = initialVariableValues[element];
return result;
}
- return compiler.withCurrentElement(element, () {
- TreeElements definitions = compiler.analyzeElement(element.declaration);
+ Element currentElement = element;
+ if (element.isParameter()
+ || element.isFieldParameter()
+ || element.isVariable()) {
+ currentElement = element.enclosingElement;
+ }
+ return compiler.withCurrentElement(currentElement, () {
+ TreeElements definitions =
+ compiler.analyzeElement(currentElement.declaration);
Constant constant = compileVariableWithDefinitions(
element, definitions, isConst: isConst);
return constant;
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698