Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library kernel.ast_from_binary; | 4 library kernel.ast_from_binary; |
| 5 | 5 |
| 6 import 'dart:convert'; | 6 import 'dart:convert'; |
| 7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 | 8 |
| 9 import '../ast.dart'; | 9 import '../ast.dart'; |
| 10 import '../transformations/flags.dart'; | 10 import '../transformations/flags.dart'; |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 _mergeNamedNodeList(library.fields, readField, library); | 392 _mergeNamedNodeList(library.fields, readField, library); |
| 393 _mergeNamedNodeList(library.procedures, readProcedure, library); | 393 _mergeNamedNodeList(library.procedures, readProcedure, library); |
| 394 | 394 |
| 395 debugPath.removeLast(); | 395 debugPath.removeLast(); |
| 396 _currentLibrary = null; | 396 _currentLibrary = null; |
| 397 return library; | 397 return library; |
| 398 } | 398 } |
| 399 | 399 |
| 400 void _readLibraryDependencies(Library library) { | 400 void _readLibraryDependencies(Library library) { |
| 401 int length = readUInt(); | 401 int length = readUInt(); |
| 402 if (library.isExternal) { | |
| 403 assert(length == 0); | |
|
Siggi Cherem (dart-lang)
2017/07/20 18:29:00
do we need the library dependencies for external l
scheglov
2017/07/20 19:33:53
Analyzer's LibraryElement has "imports" that shoul
Siggi Cherem (dart-lang)
2017/07/20 22:50:36
I see - I understand now. Thanks for the explanati
scheglov
2017/07/21 16:21:33
I agree about external libraries.
And we don't nee
| |
| 404 return; | |
| 405 } | |
| 406 library.dependencies.length = length; | 402 library.dependencies.length = length; |
| 407 for (int i = 0; i < length; ++i) { | 403 for (int i = 0; i < length; ++i) { |
| 408 var flags = readByte(); | 404 var flags = readByte(); |
| 409 var annotations = readExpressionList(); | 405 var annotations = readExpressionList(); |
| 410 var targetLibrary = readLibraryReference(); | 406 var targetLibrary = readLibraryReference(); |
| 411 var prefixName = readStringOrNullIfEmpty(); | 407 var prefixName = readStringOrNullIfEmpty(); |
| 412 var names = readCombinatorList(); | 408 var names = readCombinatorList(); |
| 413 library.dependencies[i] = new LibraryDependency.byReference( | 409 library.dependencies[i] = new LibraryDependency.byReference( |
| 414 flags, annotations, targetLibrary, prefixName, names) | 410 flags, annotations, targetLibrary, prefixName, names) |
| 415 ..parent = library; | 411 ..parent = library; |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1241 ..fileOffset = offset | 1237 ..fileOffset = offset |
| 1242 ..fileEqualsOffset = fileEqualsOffset; | 1238 ..fileEqualsOffset = fileEqualsOffset; |
| 1243 } | 1239 } |
| 1244 | 1240 |
| 1245 int readOffset() { | 1241 int readOffset() { |
| 1246 // Offset is saved as unsigned, | 1242 // Offset is saved as unsigned, |
| 1247 // but actually ranges from -1 and up (thus the -1) | 1243 // but actually ranges from -1 and up (thus the -1) |
| 1248 return readUInt() - 1; | 1244 return readUInt() - 1; |
| 1249 } | 1245 } |
| 1250 } | 1246 } |
| OLD | NEW |