| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.src.task.incremental_element_builder; | 5 library analyzer.src.task.incremental_element_builder; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 parameterElement.field = newFields[parameterElement.name]; | 327 parameterElement.field = newFields[parameterElement.name]; |
| 328 } | 328 } |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 // Update ClassElement. | 332 // Update ClassElement. |
| 333 classElement.accessors = newAccessors; | 333 classElement.accessors = newAccessors; |
| 334 classElement.constructors = classElementHolder.constructors; | 334 classElement.constructors = classElementHolder.constructors; |
| 335 classElement.fields = newFields.values.toList(); | 335 classElement.fields = newFields.values.toList(); |
| 336 classElement.methods = classElementHolder.methods; | 336 classElement.methods = classElementHolder.methods; |
| 337 classElement.version++; |
| 337 classElementHolder.validate(); | 338 classElementHolder.validate(); |
| 338 // Ensure at least a default synthetic constructor. | 339 // Ensure at least a default synthetic constructor. |
| 339 if (classElement.constructors.isEmpty) { | 340 if (classElement.constructors.isEmpty) { |
| 340 ConstructorElementImpl constructor = | 341 ConstructorElementImpl constructor = |
| 341 new ConstructorElementImpl.forNode(null); | 342 new ConstructorElementImpl.forNode(null); |
| 342 constructor.synthetic = true; | 343 constructor.synthetic = true; |
| 343 classElement.constructors = <ConstructorElement>[constructor]; | 344 classElement.constructors = <ConstructorElement>[constructor]; |
| 344 } | 345 } |
| 345 // OK | 346 // OK |
| 346 return classDelta; | 347 return classDelta; |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 } | 695 } |
| 695 } | 696 } |
| 696 super.visitElement(element); | 697 super.visitElement(element); |
| 697 } | 698 } |
| 698 | 699 |
| 699 static bool _isVariableInitializer(Element element) { | 700 static bool _isVariableInitializer(Element element) { |
| 700 return element is FunctionElement && | 701 return element is FunctionElement && |
| 701 element.enclosingElement is VariableElement; | 702 element.enclosingElement is VariableElement; |
| 702 } | 703 } |
| 703 } | 704 } |
| OLD | NEW |