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 74ab0a7d7c8..20b9e29b1dd 100644 --- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart +++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart @@ -1106,8 +1106,9 @@ abstract class BodyBuilder extends ScopeListener expression.extend(); } else { VariableDeclaration variable = new VariableDeclarationJudgment.forValue( - expression, functionNestingLevel); - push(new CascadeJudgment(variable)); + expression, functionNestingLevel) + ..fileOffset = expression.fileOffset; + push(new CascadeJudgment(variable)..fileOffset = expression.fileOffset); push(new VariableUseGenerator(this, token, variable)); } } diff --git a/pkg/front_end/lib/src/fasta/kernel/verifier.dart b/pkg/front_end/lib/src/fasta/kernel/verifier.dart index fc9e8176e8f..547e01f7e6a 100644 --- a/pkg/front_end/lib/src/fasta/kernel/verifier.dart +++ b/pkg/front_end/lib/src/fasta/kernel/verifier.dart @@ -117,7 +117,12 @@ class FastaVerifyingVisitor extends VerifyingVisitor visitAsExpression(AsExpression node) { super.visitAsExpression(node); if (node.fileOffset == -1) { - problem(node, "No offset for $node"); + TreeNode parent = node.parent; + while (parent != null) { + if (parent.fileOffset != -1) break; + parent = parent.parent; + } + problem(parent, "No offset for $node", context: node); } } diff --git a/pkg/front_end/test/fasta/bootstrap_test.dart b/pkg/front_end/test/fasta/bootstrap_test.dart index 752038c93c8..13ee2f34b20 100644 --- a/pkg/front_end/test/fasta/bootstrap_test.dart +++ b/pkg/front_end/test/fasta/bootstrap_test.dart @@ -46,18 +46,17 @@ Future main() async { Future runCompiler(Uri compiler, Uri input, Uri output) async { Uri dartVm = Uri.base.resolveUri(new Uri.file(Platform.resolvedExecutable)); - StdioProcess result = await StdioProcess.run(dartVm.toFilePath(), [ - "-c", - "--no_preview_dart_2", - compiler.toFilePath(), - "--compile-sdk=sdk/", - "--output=${output.toFilePath()}", - "--verify", - input.toFilePath(), - ]); - if (result.output.isNotEmpty) { - print(result.output); - } + StdioProcess result = await StdioProcess.run( + dartVm.toFilePath(), + [ + compiler.toFilePath(), + "--compile-sdk=sdk/", + "--output=${output.toFilePath()}", + "--verify", + "--strong", + input.toFilePath(), + ], + suppressOutput: false); if (result.exitCode != 0) { throw "Compilation failed."; } diff --git a/runtime/lib/convert_patch.dart b/runtime/lib/convert_patch.dart index 34fa1e64720..6ba84444c78 100644 --- a/runtime/lib/convert_patch.dart +++ b/runtime/lib/convert_patch.dart @@ -1075,7 +1075,7 @@ abstract class _ChunkedJsonParser { * This function scans through the string literal for escapes, and copies * slices of non-escape characters using [addSliceToString]. */ - int parseStringToBuffer(position) { + int parseStringToBuffer(int position) { int end = chunkEnd; int start = position; while (true) {