| 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 analyzer.src.generated.constant; | 5 library analyzer.src.generated.constant; |
| 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/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 } | 1792 } |
| 1793 | 1793 |
| 1794 @override | 1794 @override |
| 1795 DartObjectImpl visitMapLiteral(MapLiteral node) { | 1795 DartObjectImpl visitMapLiteral(MapLiteral node) { |
| 1796 if (node.constKeyword == null) { | 1796 if (node.constKeyword == null) { |
| 1797 _errorReporter.reportErrorForNode( | 1797 _errorReporter.reportErrorForNode( |
| 1798 CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL, node); | 1798 CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL, node); |
| 1799 return null; | 1799 return null; |
| 1800 } | 1800 } |
| 1801 bool errorOccurred = false; | 1801 bool errorOccurred = false; |
| 1802 HashMap<DartObjectImpl, DartObjectImpl> map = | 1802 LinkedHashMap<DartObjectImpl, DartObjectImpl> map = |
| 1803 new HashMap<DartObjectImpl, DartObjectImpl>(); | 1803 new LinkedHashMap<DartObjectImpl, DartObjectImpl>(); |
| 1804 for (MapLiteralEntry entry in node.entries) { | 1804 for (MapLiteralEntry entry in node.entries) { |
| 1805 DartObjectImpl keyResult = entry.key.accept(this); | 1805 DartObjectImpl keyResult = entry.key.accept(this); |
| 1806 DartObjectImpl valueResult = entry.value.accept(this); | 1806 DartObjectImpl valueResult = entry.value.accept(this); |
| 1807 if (keyResult == null || valueResult == null) { | 1807 if (keyResult == null || valueResult == null) { |
| 1808 errorOccurred = true; | 1808 errorOccurred = true; |
| 1809 } else { | 1809 } else { |
| 1810 map[keyResult] = valueResult; | 1810 map[keyResult] = valueResult; |
| 1811 } | 1811 } |
| 1812 } | 1812 } |
| 1813 if (errorOccurred) { | 1813 if (errorOccurred) { |
| (...skipping 3654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5468 return BoolState.from(_element == rightElement); | 5468 return BoolState.from(_element == rightElement); |
| 5469 } else if (rightOperand is DynamicState) { | 5469 } else if (rightOperand is DynamicState) { |
| 5470 return BoolState.UNKNOWN_VALUE; | 5470 return BoolState.UNKNOWN_VALUE; |
| 5471 } | 5471 } |
| 5472 return BoolState.FALSE_STATE; | 5472 return BoolState.FALSE_STATE; |
| 5473 } | 5473 } |
| 5474 | 5474 |
| 5475 @override | 5475 @override |
| 5476 String toString() => _element == null ? "-unknown-" : _element.name; | 5476 String toString() => _element == null ? "-unknown-" : _element.name; |
| 5477 } | 5477 } |
| OLD | NEW |