| 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 dc87c7a5ff330ca818702f10d06f086b23b6baf9..0d3e47a6abce7f195ba8c7d91dd5440ba8422a2c 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 =
|
| @@ -3001,7 +3007,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"];
|
|
|