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

Side by Side Diff: pkg/analyzer/lib/src/generated/sdk_io.dart

Issue 1684773002: Use spec.sum SDK summary and CONSTANT_EXPRESSION_RESOLVED. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months 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) 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 analyzer.src.generated.sdk_io; 5 library analyzer.src.generated.sdk_io;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 _uriToSourceMap[dartUri] = source; 549 _uriToSourceMap[dartUri] = source;
550 } 550 }
551 return source; 551 return source;
552 } 552 }
553 553
554 /** 554 /**
555 * Return the [SdkBundle] for this SDK, if it exists, or `null` otherwise. 555 * Return the [SdkBundle] for this SDK, if it exists, or `null` otherwise.
556 */ 556 */
557 SdkBundle _getSummarySdkBundle() { 557 SdkBundle _getSummarySdkBundle() {
558 String rootPath = directory.getAbsolutePath(); 558 String rootPath = directory.getAbsolutePath();
559 String path = pathos.join(rootPath, 'lib', '_internal', 'analysis_summary'); 559 String path = pathos.join(rootPath, 'lib', '_internal', 'spec.sum');
560 try { 560 try {
561 File file = new File(path); 561 File file = new File(path);
562 if (file.existsSync()) { 562 if (file.existsSync()) {
563 List<int> bytes = file.readAsBytesSync(); 563 List<int> bytes = file.readAsBytesSync();
564 return new SdkBundle.fromBuffer(bytes); 564 return new SdkBundle.fromBuffer(bytes);
565 } 565 }
566 } catch (exception, stackTrace) { 566 } catch (exception, stackTrace) {
567 AnalysisEngine.instance.logger.logError( 567 AnalysisEngine.instance.logger.logError(
568 'Failed to load SDK analysis summary from $path', 568 'Failed to load SDK analysis summary from $path',
569 new CaughtException(exception, stackTrace)); 569 new CaughtException(exception, stackTrace));
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 SdkLibrariesReader_LibraryBuilder libraryBuilder = 662 SdkLibrariesReader_LibraryBuilder libraryBuilder =
663 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); 663 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
664 // If any syntactic errors were found then don't try to visit the AST 664 // If any syntactic errors were found then don't try to visit the AST
665 // structure. 665 // structure.
666 if (!errorListener.errorReported) { 666 if (!errorListener.errorReported) {
667 unit.accept(libraryBuilder); 667 unit.accept(libraryBuilder);
668 } 668 }
669 return libraryBuilder.librariesMap; 669 return libraryBuilder.librariesMap;
670 } 670 }
671 } 671 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('j') | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698