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

Unified Diff: src/inspector/java-script-call-frame.cc

Issue 2685483002: [debugger] expose side-effect free evaluate to inspector. (Closed)
Patch Set: Created 3 years, 10 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
Index: src/inspector/java-script-call-frame.cc
diff --git a/src/inspector/java-script-call-frame.cc b/src/inspector/java-script-call-frame.cc
index aba410da6a32b9d5c1b15c21541cf04c334a7d62..c4ec604f58d574323f2620eef03777716d4955fd 100644
--- a/src/inspector/java-script-call-frame.cc
+++ b/src/inspector/java-script-call-frame.cc
@@ -98,7 +98,7 @@ v8::MaybeLocal<v8::Object> JavaScriptCallFrame::details() const {
}
v8::MaybeLocal<v8::Value> JavaScriptCallFrame::evaluate(
- v8::Local<v8::Value> expression) {
+ v8::Local<v8::Value> expression, bool allowSideEffect) {
v8::MicrotasksScope microtasks(m_isolate,
v8::MicrotasksScope::kRunMicrotasks);
v8::Local<v8::Context> context =
@@ -108,7 +108,9 @@ v8::MaybeLocal<v8::Value> JavaScriptCallFrame::evaluate(
v8::Local<v8::Function> evalFunction = v8::Local<v8::Function>::Cast(
callFrame->Get(context, toV8StringInternalized(m_isolate, "evaluate"))
.ToLocalChecked());
- return evalFunction->Call(context, callFrame, 1, &expression);
+ v8::Local<v8::Value> argv[] = {expression,
+ v8::Boolean::New(m_isolate, allowSideEffect)};
+ return evalFunction->Call(context, callFrame, arraysize(argv), argv);
}
v8::MaybeLocal<v8::Value> JavaScriptCallFrame::restart() {

Powered by Google App Engine
This is Rietveld 408576698