blob: 5be6de6e65eaea5b09c341d8ce10e4b11c3db89b [file] [log] [blame]
Ben Murdochda12d292016-06-02 14:46:10 +01001// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Flags: --expose-debug-as debug
6
7// Check that the we are still in function context when we break on return.
8
9var Debug = debug.Debug;
10
11function listener(event, exec_state, event_data, data) {
12 if (event == Debug.DebugEvent.Break) {
13 // Access scope details to check the context is correct.
14 var scope_count = exec_state.frame().scopeCount();
15 // Do steps until we reach the global scope again.
16 exec_state.prepareStep(Debug.StepAction.StepIn);
17 }
18}
19
20Debug.setListener(listener);
21
22function f() {
23 debugger;
24
25 L: with ({x:12}) {
26 break L;
27 }
28
29 return;
30}
31f();