Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: pkg/analyzer/lib/src/summary/summary_sdk.dart

Issue 2485043004: Don't serialize elements of top-level function/constructor/method bodies. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.summary.summary_sdk; 5 library analyzer.src.summary.summary_sdk;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/dart/element/type.dart'; 8 import 'package:analyzer/dart/element/type.dart';
9 import 'package:analyzer/file_system/file_system.dart' show ResourceProvider; 9 import 'package:analyzer/file_system/file_system.dart' show ResourceProvider;
10 import 'package:analyzer/src/context/cache.dart' show CacheEntry; 10 import 'package:analyzer/src/context/cache.dart' show CacheEntry;
(...skipping 30 matching lines...) Expand all
41 if (result == TYPE_PROVIDER) { 41 if (result == TYPE_PROVIDER) {
42 entry.setValue(result as ResultDescriptor<TypeProvider>, typeProvider, 42 entry.setValue(result as ResultDescriptor<TypeProvider>, typeProvider,
43 TargetedResult.EMPTY_LIST); 43 TargetedResult.EMPTY_LIST);
44 return true; 44 return true;
45 } 45 }
46 return super.compute(entry, result); 46 return super.compute(entry, result);
47 } 47 }
48 48
49 @override 49 @override
50 bool hasResultsForSource(Source source) { 50 bool hasResultsForSource(Source source) {
51 return source.source != null && source.isInSystemLibrary; 51 return source != null && source.isInSystemLibrary;
52 } 52 }
53 53
54 void _buildAsyncLibrary() { 54 void _buildAsyncLibrary() {
55 LibraryElement library = resynthesizer.getLibraryElement('dart:async'); 55 LibraryElement library = resynthesizer.getLibraryElement('dart:async');
56 typeProvider.initializeAsync(library); 56 typeProvider.initializeAsync(library);
57 } 57 }
58 58
59 void _buildCoreLibrary() { 59 void _buildCoreLibrary() {
60 LibraryElement library = resynthesizer.getLibraryElement('dart:core'); 60 LibraryElement library = resynthesizer.getLibraryElement('dart:core');
61 typeProvider.initializeCore(library); 61 typeProvider.initializeCore(library);
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 * throw a [StateError] if there is no class with the given name. 404 * throw a [StateError] if there is no class with the given name.
405 */ 405 */
406 InterfaceType _getType(LibraryElement library, String name) { 406 InterfaceType _getType(LibraryElement library, String name) {
407 Element element = library.getType(name); 407 Element element = library.getType(name);
408 if (element == null) { 408 if (element == null) {
409 throw new StateError("No definition of type $name"); 409 throw new StateError("No definition of type $name");
410 } 410 }
411 return (element as ClassElement).type; 411 return (element as ClassElement).type;
412 } 412 }
413 } 413 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698