Introduce 'replMode' flag for Runtime.evaluate

This CL adds a boolean flag to Runtime.evaluate that allows REPL
mode to be enabled. REPL mode hasn't landed in V8 yet, and the internal
API for it is still in flux.

R=yangguo@chromium.org

Bug: chromium:1004193
Change-Id: I281285e225d3fd2dd4175f3dd967d6562459a203
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1866510
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64470}
This commit is contained in:
Simon Zünd 2019-10-22 14:38:15 +02:00 committed by Commit Bot
parent b8bf5e5365
commit 6f7eeec89d
3 changed files with 4 additions and 1 deletions

View File

@ -1257,6 +1257,8 @@ domain Runtime
experimental optional TimeDelta timeout experimental optional TimeDelta timeout
# Disable breakpoints during execution. # Disable breakpoints during execution.
experimental optional boolean disableBreaks experimental optional boolean disableBreaks
# Reserved flag for future REPL mode support. Setting this flag has currently no effect.
experimental optional boolean replMode
returns returns
# Evaluation result. # Evaluation result.
RemoteObject result RemoteObject result

View File

@ -235,7 +235,7 @@ void V8RuntimeAgentImpl::evaluate(
Maybe<int> executionContextId, Maybe<bool> returnByValue, Maybe<int> executionContextId, Maybe<bool> returnByValue,
Maybe<bool> generatePreview, Maybe<bool> userGesture, Maybe<bool> generatePreview, Maybe<bool> userGesture,
Maybe<bool> awaitPromise, Maybe<bool> throwOnSideEffect, Maybe<bool> awaitPromise, Maybe<bool> throwOnSideEffect,
Maybe<double> timeout, Maybe<bool> disableBreaks, Maybe<double> timeout, Maybe<bool> disableBreaks, Maybe<bool> replMode,
std::unique_ptr<EvaluateCallback> callback) { std::unique_ptr<EvaluateCallback> callback) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"),
"EvaluateScript"); "EvaluateScript");

View File

@ -68,6 +68,7 @@ class V8RuntimeAgentImpl : public protocol::Runtime::Backend {
Maybe<bool> generatePreview, Maybe<bool> userGesture, Maybe<bool> generatePreview, Maybe<bool> userGesture,
Maybe<bool> awaitPromise, Maybe<bool> throwOnSideEffect, Maybe<bool> awaitPromise, Maybe<bool> throwOnSideEffect,
Maybe<double> timeout, Maybe<bool> disableBreaks, Maybe<double> timeout, Maybe<bool> disableBreaks,
Maybe<bool> replMode,
std::unique_ptr<EvaluateCallback>) override; std::unique_ptr<EvaluateCallback>) override;
void awaitPromise(const String16& promiseObjectId, Maybe<bool> returnByValue, void awaitPromise(const String16& promiseObjectId, Maybe<bool> returnByValue,
Maybe<bool> generatePreview, Maybe<bool> generatePreview,