2015-12-14 10:24:36 +00:00
|
|
|
// Copyright 2015 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.
|
|
|
|
|
|
|
|
|
|
|
|
Debug = debug.Debug
|
|
|
|
|
|
|
|
var exception = null;
|
|
|
|
function listener(event, exec_state, event_data, data) {
|
|
|
|
if (event != Debug.DebugEvent.Break) return;
|
|
|
|
try {
|
2016-03-31 05:58:42 +00:00
|
|
|
exec_state.frame(0).evaluate("a = 2");
|
|
|
|
exec_state.frame(0).evaluate("e = 3");
|
2015-12-14 10:24:36 +00:00
|
|
|
exec_state.frame(0).evaluate("bar()");
|
2016-03-31 05:58:42 +00:00
|
|
|
exec_state.frame(0).evaluate("a++");
|
|
|
|
exec_state.frame(0).evaluate("e++");
|
2015-12-14 10:24:36 +00:00
|
|
|
} catch (e) {
|
|
|
|
exception = e;
|
|
|
|
print(e + e.stack);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Debug.setListener(listener);
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
"use strict";
|
|
|
|
try {
|
|
|
|
throw 1;
|
|
|
|
} catch (e) {
|
|
|
|
let a = 1;
|
|
|
|
function bar() {
|
2016-03-31 05:58:42 +00:00
|
|
|
a *= 2;
|
|
|
|
e *= 2;
|
2015-12-14 10:24:36 +00:00
|
|
|
}
|
|
|
|
debugger;
|
2016-03-31 05:58:42 +00:00
|
|
|
assertEquals(5, a);
|
|
|
|
assertEquals(7, e);
|
2015-12-14 10:24:36 +00:00
|
|
|
}
|
|
|
|
})();
|
|
|
|
|
|
|
|
Debug.setListener(null);
|
|
|
|
assertNull(exception);
|