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

Unified Diff: src/debug/debug-evaluate.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/debug/debug-evaluate.cc
diff --git a/src/debug/debug-evaluate.cc b/src/debug/debug-evaluate.cc
index b36d8a21abc873419b4e33f5285aceef1500619d..e6c6a42703cb1317991031c0d83af6889a375ee0 100644
--- a/src/debug/debug-evaluate.cc
+++ b/src/debug/debug-evaluate.cc
@@ -41,13 +41,14 @@ MaybeHandle<Object> DebugEvaluate::Global(Isolate* isolate,
Handle<Context> context = isolate->native_context();
Handle<JSObject> receiver(context->global_proxy());
Handle<SharedFunctionInfo> outer_info(context->closure()->shared(), isolate);
- return Evaluate(isolate, outer_info, context, receiver, source);
+ return Evaluate(isolate, outer_info, context, receiver, source, true);
}
MaybeHandle<Object> DebugEvaluate::Local(Isolate* isolate,
StackFrame::Id frame_id,
int inlined_jsframe_index,
- Handle<String> source) {
+ Handle<String> source,
+ bool allow_side_effects) {
// Handle the processing of break.
DisableBreak disable_break_scope(isolate->debug());
@@ -74,8 +75,9 @@ MaybeHandle<Object> DebugEvaluate::Local(Isolate* isolate,
Handle<Context> context = context_builder.evaluation_context();
Handle<JSObject> receiver(context->global_proxy());
- MaybeHandle<Object> maybe_result = Evaluate(
- isolate, context_builder.outer_info(), context, receiver, source);
+ MaybeHandle<Object> maybe_result =
+ Evaluate(isolate, context_builder.outer_info(), context, receiver, source,
+ allow_side_effects);
if (!maybe_result.is_null()) context_builder.UpdateValues();
return maybe_result;
}
@@ -84,7 +86,8 @@ MaybeHandle<Object> DebugEvaluate::Local(Isolate* isolate,
// Compile and evaluate source for the given context.
MaybeHandle<Object> DebugEvaluate::Evaluate(
Isolate* isolate, Handle<SharedFunctionInfo> outer_info,
- Handle<Context> context, Handle<Object> receiver, Handle<String> source) {
+ Handle<Context> context, Handle<Object> receiver, Handle<String> source,
+ bool allow_side_effects) {
Handle<JSFunction> eval_fun;
ASSIGN_RETURN_ON_EXCEPTION(
isolate, eval_fun,
@@ -95,8 +98,7 @@ MaybeHandle<Object> DebugEvaluate::Evaluate(
Handle<Object> result;
{
- NoSideEffectScope no_side_effect(isolate,
- FLAG_side_effect_free_debug_evaluate);
+ NoSideEffectScope no_side_effect(isolate, !allow_side_effects);
ASSIGN_RETURN_ON_EXCEPTION(
isolate, result, Execution::Call(isolate, eval_fun, receiver, 0, NULL),
Object);
« no previous file with comments | « src/debug/debug-evaluate.h ('k') | src/debug/mirrors.js » ('j') | src/inspector/js_protocol.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698