Commit 735401e1 authored by Simon Zünd's avatar Simon Zünd Committed by V8 LUCI CQ

[inspector] Disable [[Scopes]] internal property

We don't remove the code just yet in case we need to re-enable the
feature. This could be in case we discover workflows not covered by
the "Scope View" and the scopes we report on "Debugger.paused".

R=kimanh@chromium.org

Bug: chromium:1365858
Change-Id: I636cc861af932156944a3f6e0a149cce0f939329
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3905185Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83379}
parent 5110b3c6
......@@ -1434,6 +1434,10 @@ bool isExperimentalAsyncStackTaggingApiEnabled() {
return i::v8_flags.experimental_async_stack_tagging_api;
}
bool isExperimentalRemoveInternalScopesPropertyEnabled() {
return i::v8_flags.experimental_remove_internal_scopes_property;
}
void RecordAsyncStackTaggingCreateTaskCall(v8::Isolate* v8_isolate) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
isolate->CountUsage(v8::Isolate::kAsyncStackTaggingCreateTaskCall);
......
......@@ -732,6 +732,7 @@ AccessorPair* AccessorPair::Cast(v8::Value* value) {
MaybeLocal<Message> GetMessageFromPromise(Local<Promise> promise);
bool isExperimentalAsyncStackTaggingApiEnabled();
bool isExperimentalRemoveInternalScopesPropertyEnabled();
void RecordAsyncStackTaggingCreateTaskCall(v8::Isolate* isolate);
......
......@@ -1701,6 +1701,8 @@ DEFINE_BOOL(experimental_value_unavailable, false,
DEFINE_BOOL(
live_edit_top_frame, true,
"enable support for live-editing the top-most function on the stack")
DEFINE_BOOL(experimental_remove_internal_scopes_property, true,
"don't report the artificial [[Scopes]] property for functions")
// disassembler
DEFINE_BOOL(log_colour, ENABLE_LOG_COLOUR,
......
......@@ -786,6 +786,11 @@ v8::MaybeLocal<v8::Array> V8Debugger::internalProperties(
toV8StringInternalized(m_isolate, "[[Entries]]"));
createDataProperty(context, properties, properties->Length(), entries);
}
if (v8::debug::isExperimentalRemoveInternalScopesPropertyEnabled()) {
return properties;
}
if (value->IsGeneratorObject()) {
v8::Local<v8::Value> scopes;
if (generatorScopes(context, value).ToLocal(&scopes)) {
......
......@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-experimental-remove-internal-scopes-property
let {session, contextGroup, Protocol} = InspectorTest.start('Tests that suspended generators produce scopes');
contextGroup.addScript(`
......
......@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-experimental-remove-internal-scopes-property
const {Protocol} = InspectorTest.start('Don\'t crash when getting the properties of a native function');
(async () => {
......
......@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-experimental-remove-internal-scopes-property
let {session, contextGroup, Protocol} = InspectorTest.start('Checks [[Scopes]] for functions');
contextGroup.addScript(`
......
......@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-experimental-remove-internal-scopes-property
let {session, contextGroup, Protocol} = InspectorTest.start('Checks internal properties in Runtime.getProperties output');
contextGroup.addScript(`
......
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