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

Unified Diff: dart/tests/standalone/debugger/local_function_test.dart

Issue 119673004: Version 1.1.0-dev.5.2 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 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: dart/tests/standalone/debugger/local_function_test.dart
===================================================================
--- dart/tests/standalone/debugger/local_function_test.dart (revision 31530)
+++ dart/tests/standalone/debugger/local_function_test.dart (working copy)
@@ -14,16 +14,38 @@
// Check that if a breakpoint is requested on the line containing the
// one-liner with a local function below, the breakpoint gets set in
// the outer function.
-foo(x) => (n) => x * n;
+foo(x) => (n) => x * n; // Breakpoint 1 on this line.
// Check that if a breakpoint is requested on the line "return n*x"
// below, the breakpoint is set in the local function (closure).
bar(x) {
return (n) {
- return n * x;
+ return n * x; // Breakpoint 2 on this line.
};
}
+// Check that setting a breakpoint works in the case where the
+// class has not been parsed yet.
+// No reference to class C must appear in main(), so that the class is not
+// yet parsed when the breakpoint in the closure nested in the constructor
+// is set.
+class C {
+ var closure;
+ C() {
+ closure = () {
+ var z = 10; // Breakpoint 3 on this line.
+ z = z * 2;
+ return z;
+ };
+ }
+}
+
+checkBpInLazilyParsedClass() {
+ var c = new C();
+ c.closure(); // Expected to hit breakpoint.
+}
+
+
main(List<String> arguments) {
if (RunScript(testScript, arguments)) return;
print("Hello from debuggee");
@@ -31,16 +53,20 @@
print(f(5));
var b = bar(10);
print(b(10)); // Hits breakpoint.
+ checkBpInLazilyParsedClass();
}
// Expected debugger events and commands.
var testScript = [
MatchFrame(0, "main"), // Top frame in trace is function "main".
- SetBreakpoint(17), // Set breakpoint in function foo.
- SetBreakpoint(23), // Set breakpoint in local function inside bar.
+ SetBreakpoint(17), // Breakpoint 1 in function foo.
+ SetBreakpoint(23), // Breakpoint 2 in local function inside bar.
+ SetBreakpoint(36), // Breakpoint 3 in local function inside constructor C.
Resume(),
MatchFrames(["foo", "main"]),
Resume(),
MatchFrames(["<anonymous closure>", "main"]),
- Resume()
+ Resume(),
+ MatchFrames(["C.<anonymous closure>", "checkBpInLazilyParsedClass"]),
+ Resume(),
];
« no previous file with comments | « dart/tests/standalone/debugger/debug_lib.dart ('k') | dart/tests/standalone/vmservice/isolate_bad_class_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698