Index: pkg/compiler/lib/src/js_backend/backend.dart |
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
index 6236ed0202a5544865e68d60a9f540e73236b377..62c863cd519526ec83f1ad85a25cea371e885bfc 100644 |
--- a/pkg/compiler/lib/src/js_backend/backend.dart |
+++ b/pkg/compiler/lib/src/js_backend/backend.dart |
@@ -2577,6 +2577,28 @@ class JavaScriptBackend extends Backend { |
} |
return rewriter.rewrite(code); |
} |
+ |
+ /// The locations of js patch-files relative to the sdk-descriptors. |
+ static const _patchLocations = const <String, String>{ |
+ "async": "_internal/js_runtime/lib/async_patch.dart", |
+ "collection": "_internal/js_runtime/lib/collection_patch.dart", |
+ "convert": "_internal/js_runtime/lib/convert_patch.dart", |
+ "core": "_internal/js_runtime/lib/core_patch.dart", |
+ "developer": "_internal/js_runtime/lib/developer_patch.dart", |
+ "io": "_internal/js_runtime/lib/io_patch.dart", |
+ "isolate": "_internal/js_runtime/lib/isolate_patch.dart", |
+ "math": "_internal/js_runtime/lib/math_patch.dart", |
+ "mirrors": "_internal/js_runtime/lib/mirrors_patch.dart", |
+ "typed_data": "_internal/js_runtime/lib/typed_data_patch.dart", |
+ "_internal": "_internal/js_runtime/lib/internal_patch.dart" |
+ }; |
+ |
+ @override |
+ Uri resolvePatchUri(String libraryName, Uri platformConfigUri) { |
+ String patchLocation = _patchLocations[libraryName]; |
+ if (patchLocation == null) return null; |
+ return platformConfigUri.resolve(patchLocation); |
+ } |
} |
/// Handling of special annotations for tests. |