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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2915153002: Follow up improvement for checking dart:_builtin (Closed)
Patch Set: 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 | « no previous file | 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/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 {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698