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

Unified Diff: pkg/kernel/lib/target/targets.dart

Issue 2953703002: Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service (Closed)
Patch Set: cl review updates: cleanup in kernel deserialization Created 3 years, 5 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/kernel/lib/binary/limited_ast_to_binary.dart ('k') | pkg/kernel/lib/target/vm.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/target/targets.dart
diff --git a/pkg/kernel/lib/target/targets.dart b/pkg/kernel/lib/target/targets.dart
index 7389dc073975ac9726a1db5356a3e626a9a70199..5618162b9a9070b2cc77b48c959e20cbe0f44798 100644
--- a/pkg/kernel/lib/target/targets.dart
+++ b/pkg/kernel/lib/target/targets.dart
@@ -114,6 +114,29 @@ abstract class Target {
void performGlobalTransformations(CoreTypes coreTypes, Program program,
{void logger(String msg)});
+ /// Whether a platform library may define a restricted type, such as `bool`,
+ /// `int`, `double`, `num`, and `String`.
+ ///
+ /// By default only `dart:core` may define restricted types, but some target
+ /// implementations override this.
+ bool mayDefineRestrictedType(Uri uri) =>
+ uri.scheme == 'dart' && uri.path == 'core';
+
+ /// Whether the `native` language extension is supported within [library].
+ ///
+ /// The `native` language extension is not part of the language specification,
+ /// it means something else to each target, and it is enabled under different
+ /// circumstances 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.
+ bool enableNative(Uri uri) => false;
+
+ /// There are two variants of the `native` language extension. The VM expects
+ /// the native token to be followed by string, whereas dart2js and DDC do not.
+ // TODO(sigmund, ahe): ideally we should remove the `native` syntax, if not,
+ // we should at least unify the VM and non-VM variants.
+ bool get nativeExtensionExpectsString => false;
+
/// Builds an expression that instantiates an [Invocation] that can be passed
/// to [noSuchMethod].
Expression instantiateInvocation(CoreTypes coreTypes, Expression receiver,
« no previous file with comments | « pkg/kernel/lib/binary/limited_ast_to_binary.dart ('k') | pkg/kernel/lib/target/vm.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698