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

Side by Side Diff: pkg/analyzer2dart/lib/src/driver.dart

Issue 812333002: Fix analyzer2dart end2end. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix latent crash in modely. Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer2dart/lib/src/dart_backend.dart ('k') | pkg/analyzer2dart/lib/src/modely.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 analyzer2dart.driver; 5 library analyzer2dart.driver;
6 6
7 import 'package:analyzer/file_system/file_system.dart'; 7 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/sdk.dart'; 10 import 'package:analyzer/src/generated/sdk.dart';
(...skipping 21 matching lines...) Expand all
32 new DartUriResolver(sdk) /* , 32 new DartUriResolver(sdk) /* ,
33 new PackageUriResolver(packagesDirectories) */ 33 new PackageUriResolver(packagesDirectories) */
34 ]; 34 ];
35 context.sourceFactory = new SourceFactory(uriResolvers); 35 context.sourceFactory = new SourceFactory(uriResolvers);
36 } 36 }
37 37
38 /** 38 /**
39 * Compute the closed world that is reachable from an entry point. 39 * Compute the closed world that is reachable from an entry point.
40 */ 40 */
41 ClosedWorld computeWorld(FunctionElement entryPointElement) { 41 ClosedWorld computeWorld(FunctionElement entryPointElement) {
42 TreeShaker treeShaker = new TreeShaker(entryPointElement); 42 InternalAnalysisContext analysisContext = context;
43 TreeShaker treeShaker =
44 new TreeShaker(analysisContext.typeProvider, entryPointElement);
43 return treeShaker.shake(); 45 return treeShaker.shake();
44 } 46 }
45 47
46 /** 48 /**
47 * Given a source, resolve it and return its entry point. 49 * Given a source, resolve it and return its entry point.
48 */ 50 */
49 FunctionElement resolveEntryPoint(Source source) { 51 FunctionElement resolveEntryPoint(Source source) {
50 // Get the library element associated with the source. 52 // Get the library element associated with the source.
51 LibraryElement libraryElement = context.computeLibraryElement(source); 53 LibraryElement libraryElement = context.computeLibraryElement(source);
52 54
(...skipping 13 matching lines...) Expand all
66 File file = resourceProvider.getResource(path); 68 File file = resourceProvider.getResource(path);
67 Source source = file.createSource(); 69 Source source = file.createSource();
68 // add the Source 70 // add the Source
69 ChangeSet changeSet = new ChangeSet(); 71 ChangeSet changeSet = new ChangeSet();
70 changeSet.addedSource(source); 72 changeSet.addedSource(source);
71 context.applyChanges(changeSet); 73 context.applyChanges(changeSet);
72 // return the Source 74 // return the Source
73 return source; 75 return source;
74 } 76 }
75 } 77 }
OLDNEW
« no previous file with comments | « pkg/analyzer2dart/lib/src/dart_backend.dart ('k') | pkg/analyzer2dart/lib/src/modely.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698