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