2015-04-14 09:08:02 +00:00
|
|
|
// Copyright 2014 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.
|
|
|
|
|
2015-12-15 09:53:55 +00:00
|
|
|
// Flags: --expose-debug-as debug --debug-eval-readonly-locals
|
2015-04-14 09:08:02 +00:00
|
|
|
|
|
|
|
Debug = debug.Debug
|
|
|
|
var exception = null;
|
|
|
|
var break_count = 0;
|
|
|
|
|
|
|
|
var f = null;
|
|
|
|
var i = null;
|
|
|
|
function listener(event, exec_state, event_data, data) {
|
|
|
|
try {
|
|
|
|
if (event == Debug.DebugEvent.Break) {
|
|
|
|
var frameMirror = exec_state.frame(0);
|
|
|
|
|
2015-12-15 09:53:55 +00:00
|
|
|
var i = frameMirror.evaluate('f = function() { i = 5; }, f(), i').value();
|
|
|
|
assertEquals(5, i);
|
2015-04-14 09:08:02 +00:00
|
|
|
}
|
|
|
|
} catch(e) {
|
|
|
|
exception = e;
|
|
|
|
print(e, e.stack);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Debug.setListener(listener);
|
|
|
|
|
|
|
|
(function (){
|
|
|
|
|
|
|
|
var i = 0;
|
|
|
|
|
|
|
|
try {
|
|
|
|
throw new Error();
|
|
|
|
} catch (e) {
|
|
|
|
assertEquals(0, i);
|
|
|
|
debugger;
|
2015-12-15 09:53:55 +00:00
|
|
|
assertEquals(0, i);
|
2015-04-14 09:08:02 +00:00
|
|
|
}
|
|
|
|
}());
|
|
|
|
|
|
|
|
assertNull(exception);
|
|
|
|
|
|
|
|
assertNull(i);
|
|
|
|
f();
|
|
|
|
assertNull(i);
|
|
|
|
|
|
|
|
Debug.setListener(null);
|