Commit 38863fc0 authored by Francis McCabe's avatar Francis McCabe Committed by Commit Bot

Revert "[debugger] Expose reference to the function in debug-evaluate"

This reverts commit 8de427fa.

Reason for revert: Seems to be causing GC memory issues:
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20nosnap%20-%20debug/24545


But, also see: https://chromium.googlesource.com/v8/v8.git/+/7440edae1da2b78a37e6fe3a558e249dc33444aa

Original change's description:
> [debugger] Expose reference to the function in debug-evaluate
> 
> R=​verwaest@chromium.org
> 
> Bug: chromium:878723
> Change-Id: Ic07f75f15230018b6d19cd1ee21f4be6dcad6360
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1667408
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62385}

TBR=yangguo@chromium.org,jgruber@chromium.org,verwaest@chromium.org

Change-Id: I099f7b2f40e8afdddc50201a8929950b2f4ac1e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:878723
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1678401Reviewed-by: 's avatarFrancis McCabe <fgm@chromium.org>
Commit-Queue: Francis McCabe <fgm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62395}
parent eaf2a23b
......@@ -624,16 +624,6 @@ bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode) const {
if (visitor(isolate_->factory()->this_string(), receiver)) return true;
}
if (current_scope_->is_function_scope()) {
Variable* function_var =
current_scope_->AsDeclarationScope()->function_var();
if (function_var != nullptr) {
Handle<JSFunction> function = frame_inspector_->GetFunction();
Handle<String> name = function_var->name();
if (visitor(name, function)) return true;
}
}
for (Variable* var : *current_scope_->locals()) {
DCHECK(!var->is_this());
if (ScopeInfo::VariableIsSynthetic(*var->name())) continue;
......
// 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) {
var frame = exec_state.frame(0);
try {
assertTrue(frame.evaluate("f").value().startsWith("function f()"));
} catch {
assertTrue(frame.sourceLineText().endsWith("throws"));
}
}
} catch(e) {
exception = e;
print(e, e.stack);
}
};
Debug.setListener(listener);
(function f() {
f;
debugger; // works
})();
(function f() {
() => f;
debugger; // works
})();
(function f() {
debugger; // throws
})();
assertNull(exception);
Debug.setListener(null);
......@@ -541,9 +541,6 @@ class DebugWrapper {
case "boolean": {
break;
}
case "function": {
value = obj.description;
}
default: {
break;
}
......
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