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

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

Issue 2895983002: Read SDK and patches from a JSON file. (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
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 48bd0e053685a86c4fbea8f3a7340298214509bd..13a203ba1fcc76f7494dc4bb4567a67bac550c54 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -92,7 +92,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
final Scope enclosingScope;
- final bool isDartLibrary;
+ final bool enableNative;
@override
final Uri uri;
@@ -163,7 +163,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
{this.fieldDependencies})
: enclosingScope = scope,
library = library,
- isDartLibrary = library.uri.scheme == "dart",
+ enableNative = (library.uri.scheme == "dart" || library.isPatch),
needsImplicitSuperInitializer =
coreTypes.objectClass != classBuilder?.cls,
typePromoter = _typeInferrer.typePromoter,
@@ -870,8 +870,9 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
return new UnresolvedAccessor(this, n, token);
}
return new ThisPropertyAccessor(this, token, n, null, null);
- } else if (isDartLibrary &&
+ } else if (enableNative &&
Siggi Cherem (dart-lang) 2017/05/22 16:21:15 you probably don't need this one here
ahe 2017/05/22 16:26:47 It's an optimization.
name == "main" &&
+ library.uri.scheme == "dart" &&
library.uri.path == "_builtin" &&
member?.name == "_getMainClosure") {
Siggi Cherem (dart-lang) 2017/05/22 16:21:15 actually - can this be deleted now that we no long
ahe 2017/05/22 16:26:47 I'll investigate.
ahe 2017/05/24 16:09:46 No. The method still exists and refers to main (wh
// TODO(ahe): https://github.com/dart-lang/sdk/issues/28989
@@ -2541,7 +2542,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
@override
Token handleUnrecoverableError(Token token, FastaMessage message) {
- if (isDartLibrary && message.code == codeExpectedFunctionBody) {
+ if (enableNative && message.code == codeExpectedFunctionBody) {
Token recover = library.loader.target.skipNativeClause(token);
if (recover != null) return recover;
} else if (message.code == codeExpectedButGot) {

Powered by Google App Engine
This is Rietveld 408576698