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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.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
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 0a2be2bd99acc854a6c2d7f9b3d4f4e0928229ca..3f7557d1bff3436940651af7a6545f8666548eba 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -17,6 +17,8 @@ import '../parser/parser.dart'
import '../parser/identifier_context.dart' show IdentifierContext;
+import '../parser/native_support.dart' show skipNativeClause;
+
import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart';
import 'package:front_end/src/fasta/kernel/utils.dart' show offsetForToken;
@@ -93,6 +95,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
final Scope enclosingScope;
final bool enableNative;
+ final bool stringExpectedAfterNative;
/// Whether to ignore an unresolved reference to `main` within the body of
/// `_getMainClosure` when compiling the current library.
@@ -180,7 +183,10 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
this._typeInferrer)
: enclosingScope = scope,
library = library,
- enableNative = library.loader.target.enableNative(library),
+ enableNative =
+ library.loader.target.backendTarget.enableNative(library.uri),
+ stringExpectedAfterNative =
+ library.loader.target.backendTarget.nativeExtensionExpectsString,
ignoreMainInGetMainClosure = library.uri.scheme == 'dart' &&
(library.uri.path == "_builtin" || library.uri.path == "ui"),
needsImplicitSuperInitializer =
@@ -2974,7 +2980,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
@override
Token handleUnrecoverableError(Token token, FastaMessage message) {
if (enableNative && message.code == codeExpectedFunctionBody) {
- Token recover = library.loader.target.skipNativeClause(token);
+ Token recover = skipNativeClause(token, stringExpectedAfterNative);
if (recover != null) return recover;
} else if (message.code == codeExpectedButGot) {
String expected = message.arguments["string"];
« no previous file with comments | « pkg/front_end/lib/src/fasta/fasta.dart ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_outline_shaker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698