| 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 dart2js.serialization.elements; | 5 library dart2js.serialization.elements; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/constructors.dart'; | 8 import '../constants/constructors.dart'; |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 98 } |
| 99 mapEncoder.setElement(name, member); | 99 mapEncoder.setElement(name, member); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 /// Serialize the source position of [element] into [encoder]. | 103 /// Serialize the source position of [element] into [encoder]. |
| 104 static void serializePosition(Element element, ObjectEncoder encoder) { | 104 static void serializePosition(Element element, ObjectEncoder encoder) { |
| 105 if (element.sourcePosition != null) { | 105 if (element.sourcePosition != null) { |
| 106 SourceSpan position = element.sourcePosition; | 106 SourceSpan position = element.sourcePosition; |
| 107 encoder.setInt(Key.OFFSET, position.begin); | 107 encoder.setInt(Key.OFFSET, position.begin); |
| 108 if (position.uri != element.compilationUnit.script.resourceUri) { | 108 /*if (position.uri != element.compilationUnit.script.resourceUri)*/ { |
| 109 // TODO(johnniwinther): What is the base URI in the case? | 109 // TODO(johnniwinther): What is the base URI in the case? |
| 110 encoder.setUri(Key.URI, element.library.canonicalUri, position.uri); | 110 encoder.setUri(Key.URI, element.library.canonicalUri, position.uri); |
| 111 } | 111 } |
| 112 int length = position.end - position.begin; | 112 int length = position.end - position.begin; |
| 113 if (element.name.length != length) { | 113 if (element.name.length != length) { |
| 114 encoder.setInt(Key.LENGTH, length); | 114 encoder.setInt(Key.LENGTH, length); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 return new LocalVariableElementZ(decoder); | 682 return new LocalVariableElementZ(decoder); |
| 683 case SerializedElementKind.EXTERNAL_LIBRARY: | 683 case SerializedElementKind.EXTERNAL_LIBRARY: |
| 684 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: | 684 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: |
| 685 case SerializedElementKind.EXTERNAL_STATIC_MEMBER: | 685 case SerializedElementKind.EXTERNAL_STATIC_MEMBER: |
| 686 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: | 686 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: |
| 687 break; | 687 break; |
| 688 } | 688 } |
| 689 throw new UnsupportedError("Unexpected element kind '${elementKind}."); | 689 throw new UnsupportedError("Unexpected element kind '${elementKind}."); |
| 690 } | 690 } |
| 691 } | 691 } |
| OLD | NEW |