mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:06:59 +00:00
70aa249370
Avoid assertion in debugger when compiling closures in mixin functions. R=asiva@google.com Review URL: https://codereview.chromium.org//102453002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30823 260f80e4-7a28-3924-810f-c04153c831b5
55 lines
1.6 KiB
Dart
55 lines
1.6 KiB
Dart
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// This test forks a second vm process that runs this dart script as
|
|
// a debug target.
|
|
// Run this test with option --wire to see the json messages sent
|
|
// between the processes.
|
|
// Run this test with option --verbose to see the stdout and stderr output
|
|
// of the debug target process.
|
|
|
|
// This test checks that a breakpoint can be set and is hit in a closure
|
|
// inside a mixin function. Regression test for issue 15325.
|
|
|
|
import "debug_lib.dart";
|
|
|
|
class S { }
|
|
|
|
class M {
|
|
m() {
|
|
var sum = 0;
|
|
[1,2,3].forEach((e) {
|
|
sum += e; // Breakpoint here.
|
|
});
|
|
return sum;
|
|
}
|
|
}
|
|
|
|
class A = S with M;
|
|
|
|
main(List<String> arguments) {
|
|
if (RunScript(testScript, arguments)) return;
|
|
var a = new A();
|
|
print(a.m());
|
|
}
|
|
|
|
// Expected debugger events and commands.
|
|
var testScript = [
|
|
MatchFrame(0, "main"), // Top frame in trace is function "main".
|
|
SetBreakpoint(23), // Set breakpoint inside the forEach closure.
|
|
Resume(),
|
|
MatchFrames(["S&M.<anonymous closure>", "forEach", "S&M.m"],
|
|
exactMatch: false), // First iteration.
|
|
MatchLocals({"e": "1"}),
|
|
Resume(),
|
|
MatchFrames(["S&M.<anonymous closure>", "forEach", "S&M.m"],
|
|
exactMatch: false), // Second iteration.
|
|
MatchLocals({"e": "2"}),
|
|
Resume(),
|
|
MatchFrames(["S&M.<anonymous closure>", "forEach", "S&M.m"],
|
|
exactMatch: false), // Third iteration.
|
|
MatchLocals({"e": "3"}),
|
|
Resume(),
|
|
];
|