Commit 1b5697cc authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

Add test for debug evaluating a previously non-whitelisted variable

This CL adds a test where we evaluate a variable that is context
allocated (through the use of 'eval'), but not used by the closure.
This did not work with the previous whitelist approach, but works now
with the new blacklist approach (see https://crrev.com/c/1795354)

Bug: v8:9482
Change-Id: I1e453dec0b624bf7e0312100e119d86c9c481ba9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1796543
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63671}
parent 1e42880e
// Copyright 2019 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) {
try {
if (event == Debug.DebugEvent.Break) {
assertEquals("n", exec_state.frame(0).evaluate("n").value());
assertEquals("m", exec_state.frame(0).evaluate("m").value());
}
} catch(e) {
exception = e;
print(e, e.stack);
}
};
Debug.setListener(listener);
(function foo () {
var n = "n";
var m = "m";
(function bar() {
assertEquals("m", eval("m")); // force context-allocation.
debugger;
})();
})();
assertNull(exception);
Debug.setListener(null);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment