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

Unified Diff: lib/custom_backend.dart

Issue 2201803002: Mark native methods as external. (Closed) Base URL: git@github.com:dart-lang/rasta.git@dill
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 | « no previous file | lib/custom_compiler_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/custom_backend.dart
diff --git a/lib/custom_backend.dart b/lib/custom_backend.dart
index 5a388f2a9ab04d33a7a2befbfb9239024962be4c..7a0e5667283f0ec5f99fcf79e7ba132bfbeb1c51 100644
--- a/lib/custom_backend.dart
+++ b/lib/custom_backend.dart
@@ -126,4 +126,15 @@ class CustomBackend extends Backend {
@override MethodElement resolveExternalFunction(MethodElement element) {
return patchResolver.resolveExternalFunction(element);
}
+
+ @override bool canLibraryUseNative(LibraryElement library) {
+ return library.isPlatformLibrary || isNativeTest(library);
+ }
+
+ /// Returns true if [library] is a test of native keyword.
+ bool isNativeTest(LibraryElement library) {
+ Uri uri = library.canonicalUri;
+ return uri.scheme == "file" &&
+ uri.path.contains("/test/kernel/regression/native/");
+ }
}
« no previous file with comments | « no previous file | lib/custom_compiler_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698