| Index: pkg/front_end/lib/src/fasta/target_implementation.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/target_implementation.dart b/pkg/front_end/lib/src/fasta/target_implementation.dart
|
| index f2e2defe1c7a3b410f236bfb6b768fe89bfe6511..e03738c93af27460ad680ecc9046054860f9dfc1 100644
|
| --- a/pkg/front_end/lib/src/fasta/target_implementation.dart
|
| +++ b/pkg/front_end/lib/src/fasta/target_implementation.dart
|
| @@ -25,6 +25,7 @@ import 'translate_uri.dart' show
|
| abstract class TargetImplementation extends Target {
|
| final TranslateUri uriTranslator;
|
| Builder cachedCompileTimeError;
|
| + Builder cachedNativeAnnotation;
|
|
|
| TargetImplementation(Ticker ticker, this.uriTranslator)
|
| : super(ticker);
|
| @@ -54,4 +55,13 @@ abstract class TargetImplementation extends Target {
|
| return cachedCompileTimeError =
|
| loader.coreLibrary.getConstructor("_CompileTimeError", isPrivate: true);
|
| }
|
| +
|
| + /// Returns a reference to the constructor used for creating `native`
|
| + /// annotations. The constructor is expected to accept a single argument of
|
| + /// type String, which is the name of the native method.
|
| + Builder getNativeAnnotation(Loader loader) {
|
| + if (cachedNativeAnnotation != null) return cachedNativeAnnotation;
|
| + LibraryBuilder internal = loader.read(Uri.parse("dart:_internal"));
|
| + return cachedNativeAnnotation = internal.getConstructor("ExternalName");
|
| + }
|
| }
|
|
|