setScriptSource

Edits JavaScript source live.

In general, functions that are currently on the stack can not be edited with a single exception: If the edited function is the top-most stack frame and that is the only activation of that function on the stack. In this case the live edit will be successful and a Debugger.restartFrame for the top-most function is automatically triggered.


suspend fun setScriptSource(scriptId: String, scriptSource: String, dryRun: Boolean? = null, allowTopFrameEditing: Boolean? = null): Debugger.SetScriptSourceReturn

Edits JavaScript source live.

In general, functions that are currently on the stack can not be edited with a single exception: If the edited function is the top-most stack frame and that is the only activation of that function on the stack. In this case the live edit will be successful and a Debugger.restartFrame for the top-most function is automatically triggered.

Parameters

scriptId

Id of the script to edit.

scriptSource

New content of the script.

dryRun

If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.

allowTopFrameEditing

If true, then scriptSource is allowed to change the function on top of the stack as long as the top-most stack frame is the only activation of that function.