Run bootstrap test in strong mode

Fixes https://github.com/dart-lang/sdk/issues/33811

Change-Id: Ie4863d5a1e8932bbf5d16a3a84236f7a66d27534
Reviewed-on: https://dart-review.googlesource.com/65084
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This commit is contained in:
Peter von der Ahé 2018-07-18 11:21:23 +00:00 committed by commit-bot@chromium.org
parent 38db4a10db
commit e7c6416f80
4 changed files with 21 additions and 16 deletions

View file

@ -1106,8 +1106,9 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
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));
}
}

View file

@ -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);
}
}

View file

@ -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(), <String>[
"-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(),
<String>[
compiler.toFilePath(),
"--compile-sdk=sdk/",
"--output=${output.toFilePath()}",
"--verify",
"--strong",
input.toFilePath(),
],
suppressOutput: false);
if (result.exitCode != 0) {
throw "Compilation failed.";
}

View file

@ -1075,7 +1075,7 @@ abstract class _ChunkedJsonParser<T> {
* 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) {