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

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

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | « lib/_internal/libraries.dart ('k') | lib/compiler/implementation/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/compile_time_constants.dart
===================================================================
--- lib/compiler/implementation/compile_time_constants.dart (revision 13683)
+++ lib/compiler/implementation/compile_time_constants.dart (working copy)
@@ -75,7 +75,7 @@
* Returns the a compile-time constant if the variable could be compiled
* eagerly. Otherwise returns `null`.
*/
- Constant compileVariable(VariableElement element, [bool isConst = false]) {
+ Constant compileVariable(VariableElement element, {bool isConst: false}) {
return measure(() {
if (initialVariableValues.containsKey(element)) {
Constant result = initialVariableValues[element];
@@ -96,7 +96,7 @@
*/
Constant compileVariableWithDefinitions(VariableElement element,
TreeElements definitions,
- [bool isConst = false]) {
+ {bool isConst: false}) {
return measure(() {
// Initializers for parameters must be const.
isConst = isConst || element.modifiers.isConst()
@@ -156,11 +156,11 @@
Constant compileNodeWithDefinitions(Node node,
TreeElements definitions,
- [bool isConst]) {
+ {bool isConst}) {
return measure(() {
assert(node !== null);
CompileTimeConstantEvaluator evaluator = new CompileTimeConstantEvaluator(
- constantSystem, definitions, compiler, isConst);
+ constantSystem, definitions, compiler, isConst: isConst);
return evaluator.evaluate(node);
});
}
@@ -248,7 +248,7 @@
CompileTimeConstantEvaluator(this.constantSystem,
this.elements,
this.compiler,
- [bool isConst])
+ {bool isConst})
: this.isEvaluatingConstant = isConst;
Constant evaluate(Node node) {
@@ -801,16 +801,16 @@
List<Constant> buildJsNewArguments(ClassElement classElement) {
List<Constant> jsNewArguments = <Constant>[];
classElement.implementation.forEachInstanceField(
+ (ClassElement enclosing, Element field) {
+ Constant fieldValue = fieldValues[field];
+ if (fieldValue === null) {
+ // Use the default value.
+ fieldValue = compiler.compileConstant(field);
+ }
+ jsNewArguments.add(fieldValue);
+ },
includeBackendMembers: true,
- includeSuperMembers: true,
- f: (ClassElement enclosing, Element field) {
- Constant fieldValue = fieldValues[field];
- if (fieldValue === null) {
- // Use the default value.
- fieldValue = compiler.compileConstant(field);
- }
- jsNewArguments.add(fieldValue);
- });
+ includeSuperMembers: true);
return jsNewArguments;
}
}
« no previous file with comments | « lib/_internal/libraries.dart ('k') | lib/compiler/implementation/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698