Commit 063384f7 authored by Ng Zhi An's avatar Ng Zhi An Committed by V8 LUCI CQ

[cleanup] Fix -Wshadow warnings in inspector

Bug: v8:12244
Change-Id: I57a54b43c1821b57ef45de38c4d7782534f74d2d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3183521Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77098}
parent c7a03c49
......@@ -609,9 +609,9 @@ std::unique_ptr<protocol::Runtime::RemoteObject> InjectedScript::wrapTable(
}
}
if (!selectedColumns.empty()) {
for (const std::unique_ptr<PropertyPreview>& column :
for (const std::unique_ptr<PropertyPreview>& prop :
*preview->getProperties()) {
ObjectPreview* columnPreview = column->getValuePreview(nullptr);
ObjectPreview* columnPreview = prop->getValuePreview(nullptr);
if (!columnPreview) continue;
// Use raw pointer here since the lifetime of each PropertyPreview is
// ensured by columnPreview. This saves an additional clone.
......
......@@ -770,12 +770,13 @@ v8::MaybeLocal<v8::Value> V8Debugger::generatorScopes(
}
v8::MaybeLocal<v8::Array> V8Debugger::collectionsEntries(
v8::Local<v8::Context> context, v8::Local<v8::Value> value) {
v8::Local<v8::Context> context, v8::Local<v8::Value> collection) {
v8::Isolate* isolate = context->GetIsolate();
v8::Local<v8::Array> entries;
bool isKeyValue = false;
if (!value->IsObject() ||
!value.As<v8::Object>()->PreviewEntries(&isKeyValue).ToLocal(&entries)) {
if (!collection->IsObject() || !collection.As<v8::Object>()
->PreviewEntries(&isKeyValue)
.ToLocal(&entries)) {
return v8::MaybeLocal<v8::Array>();
}
......
......@@ -1252,9 +1252,10 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
bool configurable = false;
bool isAccessorProperty = false;
v8::TryCatch tryCatch(isolate);
v8::TryCatch tryCatchAttributes(isolate);
if (!iterator->attributes().To(&attributes)) {
exceptionMirror = ValueMirror::create(context, tryCatch.Exception());
exceptionMirror =
ValueMirror::create(context, tryCatchAttributes.Exception());
} else {
if (iterator->is_native_accessor()) {
if (iterator->has_native_getter()) {
......@@ -1268,10 +1269,11 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
configurable = !(attributes & v8::PropertyAttribute::DontDelete);
isAccessorProperty = getterMirror || setterMirror;
} else {
v8::TryCatch tryCatch(isolate);
v8::TryCatch tryCatchDescriptor(isolate);
v8::debug::PropertyDescriptor descriptor;
if (!iterator->descriptor().To(&descriptor)) {
exceptionMirror = ValueMirror::create(context, tryCatch.Exception());
exceptionMirror =
ValueMirror::create(context, tryCatchDescriptor.Exception());
} else {
writable = descriptor.has_writable ? descriptor.writable : false;
enumerable =
......@@ -1293,7 +1295,7 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
isAccessorProperty = getterMirror || setterMirror;
if (name != "__proto__" && !getterFunction.IsEmpty() &&
getterFunction->ScriptId() == v8::UnboundScript::kNoScriptId) {
v8::TryCatch tryCatch(isolate);
v8::TryCatch tryCatchFunction(isolate);
v8::Local<v8::Value> value;
if (v8::debug::CallFunctionOn(context, getterFunction, object, 0,
nullptr, true)
......@@ -1457,10 +1459,10 @@ String16 descriptionForNode(v8::Local<v8::Context> context,
}
}
if (!description.length()) {
v8::Local<v8::Value> value;
v8::Local<v8::Value> constructor;
if (!object->Get(context, toV8String(isolate, "constructor"))
.ToLocal(&value) ||
!value->IsObject()) {
.ToLocal(&constructor) ||
!constructor->IsObject()) {
return String16();
}
if (!value.As<v8::Object>()
......
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