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

Unified Diff: pkg/analyzer/lib/src/dart/sdk/sdk.dart

Issue 2208503004: Move embedder locator and convert context builder to use the new API (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/sdk/sdk.dart
diff --git a/pkg/analyzer/lib/src/dart/sdk/sdk.dart b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
index 338a560677125f89e4fd56c48d3743aa6b4736d6..554376fbeb5d898ba4ad1f35674fe2a0f4408a56 100644
--- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart
+++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
@@ -119,6 +119,20 @@ abstract class AbstractDartSdk implements DartSdk {
_useSummary = use;
}
+ /**
+ * Add the extensions from one or more sdk extension files to this sdk. The
+ * [extensions] should be a table mapping the names of extensions to the paths
+ * where those extensions can be found.
+ */
+ void addExtensions(Map<String, String> extensions) {
+ extensions.forEach((String uri, String path) {
+ String shortName = uri.substring(uri.indexOf(':') + 1);
+ SdkLibraryImpl library = new SdkLibraryImpl(shortName);
+ library.path = path;
+ libraryMap.setLibrary(uri, library);
+ });
+ }
+
@override
Source fromFileUri(Uri uri) {
File file =
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698