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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | lib/custom_compiler_options.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library rasta.custom_backend; 5 library rasta.custom_backend;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'package:compiler/src/common/backend_api.dart' show 10 import 'package:compiler/src/common/backend_api.dart' show
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 @override bool enableDeferredLoadingIfSupported( 119 @override bool enableDeferredLoadingIfSupported(
120 Spannable node, Registry registry) => unimplemented; 120 Spannable node, Registry registry) => unimplemented;
121 121
122 @override Uri resolvePatchUri(String libraryName, Uri plaformConfigUri) { 122 @override Uri resolvePatchUri(String libraryName, Uri plaformConfigUri) {
123 return unimplemented; 123 return unimplemented;
124 } 124 }
125 125
126 @override MethodElement resolveExternalFunction(MethodElement element) { 126 @override MethodElement resolveExternalFunction(MethodElement element) {
127 return patchResolver.resolveExternalFunction(element); 127 return patchResolver.resolveExternalFunction(element);
128 } 128 }
129
130 @override bool canLibraryUseNative(LibraryElement library) {
131 return library.isPlatformLibrary || isNativeTest(library);
132 }
133
134 /// Returns true if [library] is a test of native keyword.
135 bool isNativeTest(LibraryElement library) {
136 Uri uri = library.canonicalUri;
137 return uri.scheme == "file" &&
138 uri.path.contains("/test/kernel/regression/native/");
139 }
129 } 140 }
OLDNEW
« 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