2016-06-07 06:23:22 +00:00
|
|
|
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2016-11-29 12:26:54 +00:00
|
|
|
//
|
|
|
|
// Flags: --noanalyze-environment-liveness
|
2016-06-07 06:23:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
var Debug = debug.Debug;
|
2016-11-07 09:43:08 +00:00
|
|
|
var exception = null;
|
2016-06-07 06:23:22 +00:00
|
|
|
|
|
|
|
function listener(event, exec_state, event_data, data) {
|
2016-11-07 09:43:08 +00:00
|
|
|
if (event != Debug.DebugEvent.Break) return;
|
|
|
|
try {
|
|
|
|
assertEquals(2, exec_state.frameCount());
|
|
|
|
assertEquals("a", exec_state.frame(0).localName(0));
|
|
|
|
assertEquals(1, exec_state.frame(0).localValue(0).value());
|
|
|
|
assertEquals(1, exec_state.frame(0).localCount());
|
|
|
|
} catch (e) {
|
|
|
|
exception = e;
|
|
|
|
}
|
2016-06-07 06:23:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function f() {
|
|
|
|
var a = 1;
|
|
|
|
{
|
|
|
|
let b = 2;
|
|
|
|
debugger;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-07 09:43:08 +00:00
|
|
|
Debug.setListener(listener);
|
2016-06-07 06:23:22 +00:00
|
|
|
f();
|
2016-11-07 09:43:08 +00:00
|
|
|
Debug.setListener(null);
|
|
|
|
assertNull(exception);
|