Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8ValueCopier.cpp

Issue 2269843002: [DevTools] Improve ConsoleAPI functions string description (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reverted set console in InspectedContext Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/v8_inspector/V8ValueCopier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/v8_inspector/V8ValueCopier.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8ValueCopier.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8ValueCopier.cpp
index 3347abeba5929aa7c15fa3c05afc4c3072a8232c..d95da617cf31a66b34594aa61dac973dafb47317 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8ValueCopier.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8ValueCopier.cpp
@@ -40,7 +40,7 @@ public:
v8::Local<v8::Value> copied;
if (!copy(item, depth + 1).ToLocal(&copied))
return v8::MaybeLocal<v8::Value>();
- if (!result->Set(m_to, i, copied).FromMaybe(false))
+ if (!createDataProperty(m_to, result, i, copied).FromMaybe(false))
return v8::MaybeLocal<v8::Value>();
}
return result;
@@ -63,7 +63,7 @@ public:
v8::Local<v8::Value> copied;
if (!copy(property, depth + 1).ToLocal(&copied))
return v8::MaybeLocal<v8::Value>();
- if (!result->Set(m_to, name, copied).FromMaybe(false))
+ if (!createDataProperty(m_to, result, v8::Local<v8::String>::Cast(name), copied).FromMaybe(false))
return v8::MaybeLocal<v8::Value>();
}
return result;
@@ -87,4 +87,18 @@ v8::MaybeLocal<v8::Value> copyValueFromDebuggerContext(v8::Isolate* isolate, v8:
return copier.copy(value, 0);
}
+v8::Maybe<bool> createDataProperty(v8::Local<v8::Context> context, v8::Local<v8::Object> object, v8::Local<v8::Name> key, v8::Local<v8::Value> value)
+{
+ v8::TryCatch tryCatch(context->GetIsolate());
+ v8::Isolate::DisallowJavascriptExecutionScope throwJs(context->GetIsolate(), v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
+ return object->CreateDataProperty(context, key, value);
+}
+
+v8::Maybe<bool> createDataProperty(v8::Local<v8::Context> context, v8::Local<v8::Array> array, int index, v8::Local<v8::Value> value)
+{
+ v8::TryCatch tryCatch(context->GetIsolate());
+ v8::Isolate::DisallowJavascriptExecutionScope throwJs(context->GetIsolate(), v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
+ return array->CreateDataProperty(context, index, value);
+}
+
} // namespace v8_inspector
« no previous file with comments | « third_party/WebKit/Source/platform/v8_inspector/V8ValueCopier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698