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

Unified Diff: pkg/front_end/lib/src/fasta/target_implementation.dart

Issue 2913013003: Move enableNative to target, turn it on by default (Closed)
Patch Set: cl comments + rebase Created 3 years, 7 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/front_end/lib/src/fasta/source/outline_builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 708795af65bb2c1722f76b4e9d4e9c4b58a04487..6d3ef741747c5e420f9a1ebab28b1ec377616b19 100644
--- a/pkg/front_end/lib/src/fasta/target_implementation.dart
+++ b/pkg/front_end/lib/src/fasta/target_implementation.dart
@@ -88,6 +88,20 @@ abstract class TargetImplementation extends Target {
}
}
+ /// Whether the `native` language extension is supported within [library].
+ ///
+ /// The `native` language extension is not part of the language specification,
+ /// means something else to each target, and is enabled differently for each
+ /// target implementation. For example, the VM target enables it everywhere
+ /// because of existing support for "dart-ext:" native extensions, but targets
+ /// like dart2js only enable it on the core libraries.
+ ///
+ /// This default implementation assumes a VM target, but it can be overriden
+ /// in subclasses to change the behavior.
+ // TODO(sigmund,ahe): limit this to `dart-ext` libraries only (see
+ // https://github.com/dart-lang/sdk/issues/29763).
+ bool enableNative(LibraryBuilder library) => true;
+
Token skipNativeClause(Token token) => vm.skipNativeClause(token);
String extractNativeMethodName(Token token) =>
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/outline_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698