compileScript method

Future<CompileScriptResult> compileScript(
  1. String expression,
  2. String sourceURL,
  3. bool persistScript, {
  4. ExecutionContextId? executionContextId,
})

Compiles expression. expression Expression to compile. sourceURL Source url to be set for the script. persistScript Specifies whether the compiled script should be persisted. executionContextId Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.

Implementation

Future<CompileScriptResult> compileScript(
    String expression, String sourceURL, bool persistScript,
    {ExecutionContextId? executionContextId}) async {
  var result = await _client.send('Runtime.compileScript', {
    'expression': expression,
    'sourceURL': sourceURL,
    'persistScript': persistScript,
    if (executionContextId != null) 'executionContextId': executionContextId,
  });
  return CompileScriptResult.fromJson(result);
}