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 aa73589e5226bcc93c922e6977337093c347159b..fd2f80bfdedefc24a62a26c0edac08119dc8b29a 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart |
@@ -84,7 +84,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper { |
final bool enableNative; |
- final bool isPlatformLibrary; |
+ final bool isBuiltinLibrary; |
@override |
final Uri uri; |
@@ -146,7 +146,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper { |
: enclosingScope = scope, |
library = library, |
enableNative = library.loader.target.enableNative(library), |
- isPlatformLibrary = library.uri.scheme == 'dart', |
+ isBuiltinLibrary = |
+ library.uri.scheme == 'dart' && library.uri.path == "_builtin", |
needsImplicitSuperInitializer = |
coreTypes.objectClass != classBuilder?.cls, |
typePromoter = _typeInferrer.typePromoter, |
@@ -904,13 +905,9 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper { |
return new UnresolvedAccessor(this, n, token); |
} |
return new ThisPropertyAccessor(this, token, n, null, null); |
- } else if ( |
- // Optimization, if [isPlatformLibrary] is false, this can't be |
- // dart:_builtin. |
- isPlatformLibrary && |
- name == "main" && |
- library.uri.path == "_builtin" && |
- member?.name == "_getMainClosure") { |
+ } else if (isBuiltinLibrary && |
+ name == "main" && |
+ member?.name == "_getMainClosure") { |
// TODO(ahe): https://github.com/dart-lang/sdk/issues/28989 |
return new KernelNullLiteral()..fileOffset = offsetForToken(token); |
} else { |