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

Unified Diff: dart/frog/leg/compiler.dart

Issue 9315028: Support default values for optional parameters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 11 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 | « dart/frog/leg/compile_time_constants.dart ('k') | dart/frog/leg/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/compiler.dart
===================================================================
--- dart/frog/leg/compiler.dart (revision 3790)
+++ dart/frog/leg/compiler.dart (working copy)
@@ -212,7 +212,8 @@
String codegen(WorkItem work) {
String code;
- if (work.element.kind == ElementKind.FIELD) {
+ if (work.element.kind == ElementKind.FIELD
+ || work.element.kind == ElementKind.PARAMETER) {
compileTimeConstantHandler.compileWorkItem(work);
return null;
} else {
@@ -271,6 +272,14 @@
return resolver.resolveSignature(element);
}
+ Object compileVariable(VariableElement element) {
+ Element savedElement = currentElement;
+ currentElement = element;
+ compile(new WorkItem.toCompile(element));
+ currentElement = savedElement;
+ return compileTimeConstantHandler.compileVariable(element);
+ }
+
reportWarning(Node node, var message) {}
reportError(Node node, var message) {}
« no previous file with comments | « dart/frog/leg/compile_time_constants.dart ('k') | dart/frog/leg/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698