Chromium Code Reviews| 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 dart_tree_printer; | 5 library dart_tree_printer; |
| 6 | 6 |
| 7 import '../constants/values.dart' as values; | 7 import '../constants/values.dart' as values; |
| 8 import '../dart_types.dart' as types; | 8 import '../dart_types.dart' as types; |
| 9 import '../dart2jslib.dart' as dart2js; | 9 import '../dart2jslib.dart' as dart2js; |
| 10 import '../elements/elements.dart' as elements; | 10 import '../elements/elements.dart' as elements; |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 969 null, // body | 969 null, // body |
| 970 param.type == null ? null : makeType(param.type), | 970 param.type == null ? null : makeType(param.type), |
| 971 makeEmptyModifiers(), // TODO: Function parameter modifiers? | 971 makeEmptyModifiers(), // TODO: Function parameter modifiers? |
| 972 null, // initializers | 972 null, // initializers |
| 973 null, // get/set | 973 null, // get/set |
| 974 null); // async modifier | 974 null); // async modifier |
| 975 if (param.element != null) { | 975 if (param.element != null) { |
| 976 setElement(definition, param.element, param); | 976 setElement(definition, param.element, param); |
| 977 } | 977 } |
| 978 if (param.defaultValue != null) { | 978 if (param.defaultValue != null) { |
| 979 return new tree.SendSet( | 979 definition = new tree.SendSet( |
|
Johnni Winther
2015/03/05 10:48:01
This fixes a crash in language/issue13179_test
| |
| 980 null, | 980 null, |
| 981 definition, | 981 definition, |
| 982 new tree.Operator(assignOperator), | 982 new tree.Operator(assignOperator), |
| 983 singleton(makeExpression(param.defaultValue))); | 983 singleton(makeExpression(param.defaultValue))); |
| 984 } else { | |
| 985 return new tree.VariableDefinitions( | |
| 986 null, | |
| 987 makeEmptyModifiers(), | |
| 988 singleton(definition)); | |
| 989 } | 984 } |
| 985 return new tree.VariableDefinitions( | |
| 986 null, | |
| 987 makeEmptyModifiers(), | |
| 988 singleton(definition)); | |
| 990 } else { | 989 } else { |
| 991 tree.Node definition; | 990 tree.Node definition; |
| 992 if (param.defaultValue != null) { | 991 if (param.defaultValue != null) { |
| 993 definition = new tree.SendSet( | 992 definition = new tree.SendSet( |
| 994 null, | 993 null, |
| 995 makeIdentifier(param.name), | 994 makeIdentifier(param.name), |
| 996 new tree.Operator(assignOperator), | 995 new tree.Operator(assignOperator), |
| 997 singleton(makeExpression(param.defaultValue))); | 996 singleton(makeExpression(param.defaultValue))); |
| 998 } else { | 997 } else { |
| 999 definition = makeIdentifier(param.name); | 998 definition = makeIdentifier(param.name); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1334 printStringChunk(chunk.previous), | 1333 printStringChunk(chunk.previous), |
| 1335 node); | 1334 node); |
| 1336 } else { | 1335 } else { |
| 1337 return node; | 1336 return node; |
| 1338 } | 1337 } |
| 1339 } | 1338 } |
| 1340 return printStringChunk(output.chunk); | 1339 return printStringChunk(output.chunk); |
| 1341 } | 1340 } |
| 1342 | 1341 |
| 1343 } | 1342 } |
| OLD | NEW |