| 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 | 4 |
| 5 library analyzer.src.summary.summary_file_builder; | 5 library analyzer.src.summary.summary_file_builder; |
| 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/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 FolderBasedDartSdk sdk = new FolderBasedDartSdk( | 45 FolderBasedDartSdk sdk = new FolderBasedDartSdk( |
| 46 resourceProvider, resourceProvider.getFolder(sdkPath), strong); | 46 resourceProvider, resourceProvider.getFolder(sdkPath), strong); |
| 47 sdk.useSummary = false; | 47 sdk.useSummary = false; |
| 48 sdk.analysisOptions = new AnalysisOptionsImpl()..strongMode = strong; | 48 sdk.analysisOptions = new AnalysisOptionsImpl()..strongMode = strong; |
| 49 | 49 |
| 50 // | 50 // |
| 51 // Prepare 'dart:' URIs to serialize. | 51 // Prepare 'dart:' URIs to serialize. |
| 52 // | 52 // |
| 53 Set<String> uriSet = | 53 Set<String> uriSet = |
| 54 sdk.sdkLibraries.map((SdkLibrary library) => library.shortName).toSet(); | 54 sdk.sdkLibraries.map((SdkLibrary library) => library.shortName).toSet(); |
| 55 if (!strong) { | |
| 56 uriSet.add('dart:html/nativewrappers.dart'); | |
| 57 } | |
| 58 uriSet.add('dart:html_common/html_common_dart2js.dart'); | 55 uriSet.add('dart:html_common/html_common_dart2js.dart'); |
| 59 | 56 |
| 60 Set<Source> librarySources = new HashSet<Source>(); | 57 Set<Source> librarySources = new HashSet<Source>(); |
| 61 for (String uri in uriSet) { | 58 for (String uri in uriSet) { |
| 62 librarySources.add(sdk.mapDartUri(uri)); | 59 librarySources.add(sdk.mapDartUri(uri)); |
| 63 } | 60 } |
| 64 | 61 |
| 65 return new SummaryBuilder(librarySources, sdk.context, strong); | 62 return new SummaryBuilder(librarySources, sdk.context, strong); |
| 66 } | 63 } |
| 67 | 64 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 scanner.scanGenericMethodComments = strong; | 138 scanner.scanGenericMethodComments = strong; |
| 142 Token token = scanner.tokenize(); | 139 Token token = scanner.tokenize(); |
| 143 LineInfo lineInfo = new LineInfo(scanner.lineStarts); | 140 LineInfo lineInfo = new LineInfo(scanner.lineStarts); |
| 144 Parser parser = new Parser(source, errorListener); | 141 Parser parser = new Parser(source, errorListener); |
| 145 parser.parseGenericMethodComments = strong; | 142 parser.parseGenericMethodComments = strong; |
| 146 CompilationUnit unit = parser.parseCompilationUnit(token); | 143 CompilationUnit unit = parser.parseCompilationUnit(token); |
| 147 unit.lineInfo = lineInfo; | 144 unit.lineInfo = lineInfo; |
| 148 return unit; | 145 return unit; |
| 149 } | 146 } |
| 150 } | 147 } |
| OLD | NEW |