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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.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
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 175bdcfd53a11984dbee2462301bbe0ec2e7764e..0fd71b135cb05f70750a66a1ef317deb1b1913d2 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -84,6 +84,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
final bool enableNative;
+ final bool isPlatformLibrary;
+
@override
final Uri uri;
@@ -143,7 +145,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
this._typeInferrer)
: enclosingScope = scope,
library = library,
- enableNative = (library.uri.scheme == "dart" || library.isPatch),
+ enableNative = library.loader.target.enableNative(library),
+ isPlatformLibrary = library.uri.scheme == 'dart',
needsImplicitSuperInitializer =
coreTypes.objectClass != classBuilder?.cls,
typePromoter = _typeInferrer.typePromoter,
@@ -905,11 +908,10 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
}
return new ThisPropertyAccessor(this, token, n, null, null);
} else if (
- // Optimization, if [enableNative] is false, this can't be
+ // Optimization, if [isPlatformLibrary] is false, this can't be
// dart:_builtin.
- enableNative &&
+ isPlatformLibrary &&
name == "main" &&
- library.uri.scheme == "dart" &&
library.uri.path == "_builtin" &&
member?.name == "_getMainClosure") {
// TODO(ahe): https://github.com/dart-lang/sdk/issues/28989
« no previous file with comments | « pkg/compiler/lib/src/kernel/fasta_support.dart ('k') | pkg/front_end/lib/src/fasta/source/diet_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698