blob: f9496ae87d9f8b6d01dd448796c6eb5d628a466a [file] [log] [blame]
Ben Murdoch61f157c2016-09-16 13:49:30 +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
7var Debug = debug.Debug;
8var steps = 0;
9var exception = null;
10
11function listener(event, execState, eventData, data) {
12 if (event != Debug.DebugEvent.Break) return;
13 try {
14 assertEquals([ debug.ScopeType.Local,
15 debug.ScopeType.Script,
16 debug.ScopeType.Global],
17 execState.frame().allScopes().map(s => s.scopeType()));
18 var x_value = execState.frame().evaluate("x").value();
19 if (steps < 2) {
20 assertEquals(undefined, x_value);
21 execState.prepareStep(Debug.StepAction.StepIn);
22 } else {
23 assertEquals("l => l", x_value.toString());
24 }
25 steps++;
26 } catch (e) {
27 exception = e;
28 }
29}
30
31Debug.setListener(listener);
32
33(function() {
34 debugger;
35 var x = l => l;
36})();
37
38Debug.setListener(null);
39assertNull(exception);
40assertEquals(3, steps);