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

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

Issue 11740019: Fix issue 7677: recognize const declarations inside methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 12 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 | tests/language/language_dart2js.status » ('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 16601)
+++ sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (working copy)
@@ -462,6 +462,11 @@
if (result != null) return result;
} else if (Elements.isClass(element) || Elements.isTypedef(element)) {
return makeTypeConstant(element);
ahe 2013/01/03 14:09:26 To ease my mind, could you add this: } else if (s
ngeoffray 2013/01/08 14:36:11 This is not easing mine :) Where do you want to pu
ahe 2013/01/18 11:07:11 Right here, before the new code.
ngeoffray 2013/01/18 11:15:30 Done.
+ } else if (!Elements.isUnresolved(element)
+ && element.isVariable()
+ && element.modifiers.isConst()) {
+ Constant result = handler.compileConstant(element);
+ if (result != null) return result;
}
return signalNotCompileTimeConstant(send);
} else if (send.isCall) {
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698