001package Torello.Browser;
002
003import java.util.*;
004import javax.json.*;
005import javax.json.stream.*;
006import java.io.*;
007
008import java.lang.reflect.Method;
009import java.lang.reflect.Parameter;
010import java.util.function.Function;
011
012import Torello.Java.Additional.*;
013
014import static Torello.Java.Additional.JFlag.*;
015
016import Torello.Java.StrCmpr;
017import Torello.JavaDoc.StaticFunctional;
018import Torello.JavaDoc.JDHeaderBackgroundImg;
019import Torello.JavaDoc.Excuse;
020
021/**
022 * <SPAN CLASS=CopiedJDK><B>Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing
023 * breakpoints, stepping through execution, exploring stack traces, etc.</B></SPAN>
024 * 
025 * <EMBED CLASS='external-html' DATA-FILE-ID=CODE_GEN_NOTE>
026 */
027@StaticFunctional(Excused={"counter"}, Excuses={Excuse.CONFIGURATION})
028@JDHeaderBackgroundImg(EmbedTagFileID="WOOD_PLANK_NOTE")
029public class Debugger
030{
031    // ********************************************************************************************
032    // ********************************************************************************************
033    // Class Header Stuff
034    // ********************************************************************************************
035    // ********************************************************************************************
036
037
038    // No Pubic Constructors
039    private Debugger () { }
040
041    // These two Vector's are used by all the "Methods" exported by this class.  java.lang.reflect
042    // is used to generate the JSON String's.  It saves thousands of lines of Auto-Generated Code.
043    private static final Map<String, Vector<String>>    parameterNames = new HashMap<>();
044    private static final Map<String, Vector<Class<?>>>  parameterTypes = new HashMap<>();
045
046    // Some Methods do not take any parameters - for instance all the "enable()" and "disable()"
047    // I simply could not get ride of RAW-TYPES and UNCHECKED warnings... so there are now,
048    // offically, two empty-vectors.  One for String's, and the other for Classes.
049
050    private static final Vector<String>     EMPTY_VEC_STR = new Vector<>();
051    private static final Vector<Class<?>>   EMPTY_VEC_CLASS = new Vector<>();
052
053    static
054    {
055        for (Method m : Debugger.class.getMethods())
056        {
057            // This doesn't work!  The parameter names are all "arg0" ... "argN"
058            // It works for java.lang.reflect.Field, BUT NOT java.lang.reflect.Parameter!
059            //
060            // Vector<String> parameterNamesList = new Vector<>(); -- NOPE!
061
062            Vector<Class<?>> parameterTypesList = new Vector<>();
063        
064            for (Parameter p : m.getParameters()) parameterTypesList.add(p.getType());
065
066            parameterTypes.put(
067                m.getName(),
068                (parameterTypesList.size() > 0) ? parameterTypesList : EMPTY_VEC_CLASS
069            );
070        }
071    }
072
073    static
074    {
075        Vector<String> v = null;
076
077        v = new Vector<String>(2);
078        parameterNames.put("continueToLocation", v);
079        Collections.addAll(v, new String[]
080        { "location", "targetCallFrames", });
081
082        parameterNames.put("disable", EMPTY_VEC_STR);
083
084        v = new Vector<String>(1);
085        parameterNames.put("enable", v);
086        Collections.addAll(v, new String[]
087        { "maxScriptsCacheSize", });
088
089        v = new Vector<String>(9);
090        parameterNames.put("evaluateOnCallFrame", v);
091        Collections.addAll(v, new String[]
092        { "callFrameId", "expression", "objectGroup", "includeCommandLineAPI", "silent", "returnByValue", "generatePreview", "throwOnSideEffect", "timeout", });
093
094        v = new Vector<String>(3);
095        parameterNames.put("getPossibleBreakpoints", v);
096        Collections.addAll(v, new String[]
097        { "start", "end", "restrictToFunction", });
098
099        v = new Vector<String>(1);
100        parameterNames.put("getScriptSource", v);
101        Collections.addAll(v, new String[]
102        { "scriptId", });
103
104        v = new Vector<String>(1);
105        parameterNames.put("getWasmBytecode", v);
106        Collections.addAll(v, new String[]
107        { "scriptId", });
108
109        v = new Vector<String>(1);
110        parameterNames.put("getStackTrace", v);
111        Collections.addAll(v, new String[]
112        { "stackTraceId", });
113
114        parameterNames.put("pause", EMPTY_VEC_STR);
115
116        v = new Vector<String>(1);
117        parameterNames.put("pauseOnAsyncCall", v);
118        Collections.addAll(v, new String[]
119        { "parentStackTraceId", });
120
121        v = new Vector<String>(1);
122        parameterNames.put("removeBreakpoint", v);
123        Collections.addAll(v, new String[]
124        { "breakpointId", });
125
126        v = new Vector<String>(1);
127        parameterNames.put("restartFrame", v);
128        Collections.addAll(v, new String[]
129        { "callFrameId", });
130
131        v = new Vector<String>(1);
132        parameterNames.put("resume", v);
133        Collections.addAll(v, new String[]
134        { "terminateOnResume", });
135
136        v = new Vector<String>(4);
137        parameterNames.put("searchInContent", v);
138        Collections.addAll(v, new String[]
139        { "scriptId", "query", "caseSensitive", "isRegex", });
140
141        v = new Vector<String>(1);
142        parameterNames.put("setAsyncCallStackDepth", v);
143        Collections.addAll(v, new String[]
144        { "maxDepth", });
145
146        v = new Vector<String>(1);
147        parameterNames.put("setBlackboxPatterns", v);
148        Collections.addAll(v, new String[]
149        { "patterns", });
150
151        v = new Vector<String>(2);
152        parameterNames.put("setBlackboxedRanges", v);
153        Collections.addAll(v, new String[]
154        { "scriptId", "positions", });
155
156        v = new Vector<String>(2);
157        parameterNames.put("setBreakpoint", v);
158        Collections.addAll(v, new String[]
159        { "location", "condition", });
160
161        v = new Vector<String>(1);
162        parameterNames.put("setInstrumentationBreakpoint", v);
163        Collections.addAll(v, new String[]
164        { "instrumentation", });
165
166        v = new Vector<String>(6);
167        parameterNames.put("setBreakpointByUrl", v);
168        Collections.addAll(v, new String[]
169        { "lineNumber", "url", "urlRegex", "scriptHash", "columnNumber", "condition", });
170
171        v = new Vector<String>(2);
172        parameterNames.put("setBreakpointOnFunctionCall", v);
173        Collections.addAll(v, new String[]
174        { "objectId", "condition", });
175
176        v = new Vector<String>(1);
177        parameterNames.put("setBreakpointsActive", v);
178        Collections.addAll(v, new String[]
179        { "active", });
180
181        v = new Vector<String>(1);
182        parameterNames.put("setPauseOnExceptions", v);
183        Collections.addAll(v, new String[]
184        { "state", });
185
186        v = new Vector<String>(1);
187        parameterNames.put("setReturnValue", v);
188        Collections.addAll(v, new String[]
189        { "newValue", });
190
191        v = new Vector<String>(3);
192        parameterNames.put("setScriptSource", v);
193        Collections.addAll(v, new String[]
194        { "scriptId", "scriptSource", "dryRun", });
195
196        v = new Vector<String>(1);
197        parameterNames.put("setSkipAllPauses", v);
198        Collections.addAll(v, new String[]
199        { "skip", });
200
201        v = new Vector<String>(4);
202        parameterNames.put("setVariableValue", v);
203        Collections.addAll(v, new String[]
204        { "scopeNumber", "variableName", "newValue", "callFrameId", });
205
206        v = new Vector<String>(2);
207        parameterNames.put("stepInto", v);
208        Collections.addAll(v, new String[]
209        { "breakOnAsyncCall", "skipList", });
210
211        parameterNames.put("stepOut", EMPTY_VEC_STR);
212
213        v = new Vector<String>(1);
214        parameterNames.put("stepOver", v);
215        Collections.addAll(v, new String[]
216        { "skipList", });
217    }
218
219
220    // ********************************************************************************************
221    // ********************************************************************************************
222    // Types - Static Inner Classes
223    // ********************************************************************************************
224    // ********************************************************************************************
225
226    // public static class BreakpointId => String
227    
228    // public static class CallFrameId => String
229    
230    /** Enum of possible script languages. */
231    public static final String[] ScriptLanguage =
232    { "JavaScript", "WebAssembly", };
233    
234    /** Location in the source code. */
235    public static class Location extends BaseType
236    {
237        /** For Object Serialization.  java.io.Serializable */
238        protected static final long serialVersionUID = 1;
239        
240        public boolean[] optionals()
241        { return new boolean[] { false, false, true, }; }
242        
243        /** Script identifier as reported in the <CODE>Debugger.scriptParsed</CODE>. */
244        public final String scriptId;
245        
246        /** Line number in the script (0-based). */
247        public final int lineNumber;
248        
249        /**
250         * Column number in the script (0-based).
251         * <BR />
252         * <BR /><B>OPTIONAL</B>
253         */
254        public final Integer columnNumber;
255        
256        /**
257         * Constructor
258         *
259         * @param scriptId Script identifier as reported in the <CODE>Debugger.scriptParsed</CODE>.
260         * 
261         * @param lineNumber Line number in the script (0-based).
262         * 
263         * @param columnNumber Column number in the script (0-based).
264         * <BR /><B>OPTIONAL</B>
265         */
266        public Location(String scriptId, int lineNumber, Integer columnNumber)
267        {
268            // Exception-Check(s) to ensure that if any parameters which are not declared as
269            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
270            
271            if (scriptId == null) BRDPC.throwNPE("scriptId");
272            
273            this.scriptId      = scriptId;
274            this.lineNumber    = lineNumber;
275            this.columnNumber  = columnNumber;
276        }
277        
278        /**
279         * JSON Object Constructor
280         * @param jo A Json-Object having data about an instance of {@code 'Location'}.
281         */
282        public Location (JsonObject jo)
283        {
284            this.scriptId      = ReadJSON.getString(jo, "scriptId", false, true);
285            this.lineNumber    = ReadJSON.getInt(jo, "lineNumber");
286            this.columnNumber  = ReadJSON.getINTEGER(jo, "columnNumber", true);
287        }
288        
289    }
290    
291    /**
292     * Location in the source code.
293     * <BR />
294     * <BR /><B>EXPERIMENTAL</B>
295     */
296    public static class ScriptPosition extends BaseType
297    {
298        /** For Object Serialization.  java.io.Serializable */
299        protected static final long serialVersionUID = 1;
300        
301        public boolean[] optionals()
302        { return new boolean[] { false, false, }; }
303        
304        /** <CODE>[No Description Provided by Google]</CODE> */
305        public final int lineNumber;
306        
307        /** <CODE>[No Description Provided by Google]</CODE> */
308        public final int columnNumber;
309        
310        /**
311         * Constructor
312         *
313         * @param lineNumber -
314         * 
315         * @param columnNumber -
316         */
317        public ScriptPosition(int lineNumber, int columnNumber)
318        {
319            this.lineNumber    = lineNumber;
320            this.columnNumber  = columnNumber;
321        }
322        
323        /**
324         * JSON Object Constructor
325         * @param jo A Json-Object having data about an instance of {@code 'ScriptPosition'}.
326         */
327        public ScriptPosition (JsonObject jo)
328        {
329            this.lineNumber    = ReadJSON.getInt(jo, "lineNumber");
330            this.columnNumber  = ReadJSON.getInt(jo, "columnNumber");
331        }
332        
333    }
334    
335    /**
336     * Location range within one script.
337     * <BR />
338     * <BR /><B>EXPERIMENTAL</B>
339     */
340    public static class LocationRange extends BaseType
341    {
342        /** For Object Serialization.  java.io.Serializable */
343        protected static final long serialVersionUID = 1;
344        
345        public boolean[] optionals()
346        { return new boolean[] { false, false, false, }; }
347        
348        /** <CODE>[No Description Provided by Google]</CODE> */
349        public final String scriptId;
350        
351        /** <CODE>[No Description Provided by Google]</CODE> */
352        public final Debugger.ScriptPosition start;
353        
354        /** <CODE>[No Description Provided by Google]</CODE> */
355        public final Debugger.ScriptPosition end;
356        
357        /**
358         * Constructor
359         *
360         * @param scriptId -
361         * 
362         * @param start -
363         * 
364         * @param end -
365         */
366        public LocationRange
367            (String scriptId, Debugger.ScriptPosition start, Debugger.ScriptPosition end)
368        {
369            // Exception-Check(s) to ensure that if any parameters which are not declared as
370            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
371            
372            if (scriptId == null) BRDPC.throwNPE("scriptId");
373            if (start == null)    BRDPC.throwNPE("start");
374            if (end == null)      BRDPC.throwNPE("end");
375            
376            this.scriptId  = scriptId;
377            this.start     = start;
378            this.end       = end;
379        }
380        
381        /**
382         * JSON Object Constructor
383         * @param jo A Json-Object having data about an instance of {@code 'LocationRange'}.
384         */
385        public LocationRange (JsonObject jo)
386        {
387            this.scriptId  = ReadJSON.getString(jo, "scriptId", false, true);
388            this.start     = ReadJSON.XL.getObject(jo, "start", Debugger.ScriptPosition.class, false, true);
389            this.end       = ReadJSON.XL.getObject(jo, "end", Debugger.ScriptPosition.class, false, true);
390        }
391        
392    }
393    
394    /** JavaScript call frame. Array of call frames form the call stack. */
395    public static class CallFrame extends BaseType
396    {
397        /** For Object Serialization.  java.io.Serializable */
398        protected static final long serialVersionUID = 1;
399        
400        public boolean[] optionals()
401        { return new boolean[] { false, false, true, false, false, false, false, true, }; }
402        
403        /** Call frame identifier. This identifier is only valid while the virtual machine is paused. */
404        public final String callFrameId;
405        
406        /** Name of the JavaScript function called on this call frame. */
407        public final String functionName;
408        
409        /**
410         * Location in the source code.
411         * <BR />
412         * <BR /><B>OPTIONAL</B>
413         */
414        public final Debugger.Location functionLocation;
415        
416        /** Location in the source code. */
417        public final Debugger.Location location;
418        
419        /** JavaScript script name or url. */
420        public final String url;
421        
422        /** Scope chain for this call frame. */
423        public final Debugger.Scope[] scopeChain;
424        
425        /** <CODE>this</CODE> object for this call frame. */
426        public final RunTime.RemoteObject _this;
427        
428        /**
429         * The value being returned, if the function is at return point.
430         * <BR />
431         * <BR /><B>OPTIONAL</B>
432         */
433        public final RunTime.RemoteObject returnValue;
434        
435        /**
436         * Constructor
437         *
438         * @param callFrameId Call frame identifier. This identifier is only valid while the virtual machine is paused.
439         * 
440         * @param functionName Name of the JavaScript function called on this call frame.
441         * 
442         * @param functionLocation Location in the source code.
443         * <BR /><B>OPTIONAL</B>
444         * 
445         * @param location Location in the source code.
446         * 
447         * @param url JavaScript script name or url.
448         * 
449         * @param scopeChain Scope chain for this call frame.
450         * 
451         * @param _this <CODE>this</CODE> object for this call frame.
452         * 
453         * @param returnValue The value being returned, if the function is at return point.
454         * <BR /><B>OPTIONAL</B>
455         */
456        public CallFrame(
457                String callFrameId, String functionName, Debugger.Location functionLocation, 
458                Debugger.Location location, String url, Debugger.Scope[] scopeChain, 
459                RunTime.RemoteObject _this, RunTime.RemoteObject returnValue
460            )
461        {
462            // Exception-Check(s) to ensure that if any parameters which are not declared as
463            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
464            
465            if (callFrameId == null)  BRDPC.throwNPE("callFrameId");
466            if (functionName == null) BRDPC.throwNPE("functionName");
467            if (location == null)     BRDPC.throwNPE("location");
468            if (url == null)          BRDPC.throwNPE("url");
469            if (scopeChain == null)   BRDPC.throwNPE("scopeChain");
470            if (_this == null)        BRDPC.throwNPE("_this");
471            
472            this.callFrameId       = callFrameId;
473            this.functionName      = functionName;
474            this.functionLocation  = functionLocation;
475            this.location          = location;
476            this.url               = url;
477            this.scopeChain        = scopeChain;
478            this._this             = _this;
479            this.returnValue       = returnValue;
480        }
481        
482        /**
483         * JSON Object Constructor
484         * @param jo A Json-Object having data about an instance of {@code 'CallFrame'}.
485         */
486        public CallFrame (JsonObject jo)
487        {
488            this.callFrameId       = ReadJSON.getString(jo, "callFrameId", false, true);
489            this.functionName      = ReadJSON.getString(jo, "functionName", false, true);
490            this.functionLocation  = ReadJSON.XL.getObject(jo, "functionLocation", Debugger.Location.class, true, false);
491            this.location          = ReadJSON.XL.getObject(jo, "location", Debugger.Location.class, false, true);
492            this.url               = ReadJSON.getString(jo, "url", false, true);
493            this.scopeChain        = (jo.getJsonArray("scopeChain") == null)
494            ? null
495            : ReadArrJSON.DimN.objArr(jo.getJsonArray("scopeChain"), null, 0, Debugger.Scope[].class);
496            this._this             = ReadJSON.XL.getObject(jo, "this", RunTime.RemoteObject.class, false, true);
497            this.returnValue       = ReadJSON.XL.getObject(jo, "returnValue", RunTime.RemoteObject.class, true, false);
498        }
499        
500    }
501    
502    /** Scope description. */
503    public static class Scope extends BaseType
504    {
505        /** For Object Serialization.  java.io.Serializable */
506        protected static final long serialVersionUID = 1;
507        
508        public boolean[] optionals()
509        { return new boolean[] { false, false, true, true, true, }; }
510        
511        /** Scope type. */
512        public final String type;
513        
514        /**
515         * Object representing the scope. For <CODE>global</CODE> and <CODE>with</CODE> scopes it represents the actual
516         * object; for the rest of the scopes, it is artificial transient object enumerating scope
517         * variables as its properties.
518         */
519        public final RunTime.RemoteObject object;
520        
521        /**
522         * <CODE>[No Description Provided by Google]</CODE>
523         * <BR />
524         * <BR /><B>OPTIONAL</B>
525         */
526        public final String name;
527        
528        /**
529         * Location in the source code where scope starts
530         * <BR />
531         * <BR /><B>OPTIONAL</B>
532         */
533        public final Debugger.Location startLocation;
534        
535        /**
536         * Location in the source code where scope ends
537         * <BR />
538         * <BR /><B>OPTIONAL</B>
539         */
540        public final Debugger.Location endLocation;
541        
542        /**
543         * Constructor
544         *
545         * @param type Scope type.
546         * <BR />Acceptable Values: ["global", "local", "with", "closure", "catch", "block", "script", "eval", "module", "wasm-expression-stack"]
547         * 
548         * @param object 
549         * Object representing the scope. For <CODE>global</CODE> and <CODE>with</CODE> scopes it represents the actual
550         * object; for the rest of the scopes, it is artificial transient object enumerating scope
551         * variables as its properties.
552         * 
553         * @param name -
554         * <BR /><B>OPTIONAL</B>
555         * 
556         * @param startLocation Location in the source code where scope starts
557         * <BR /><B>OPTIONAL</B>
558         * 
559         * @param endLocation Location in the source code where scope ends
560         * <BR /><B>OPTIONAL</B>
561         */
562        public Scope(
563                String type, RunTime.RemoteObject object, String name, 
564                Debugger.Location startLocation, Debugger.Location endLocation
565            )
566        {
567            // Exception-Check(s) to ensure that if any parameters which are not declared as
568            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
569            
570            if (type == null)   BRDPC.throwNPE("type");
571            if (object == null) BRDPC.throwNPE("object");
572            
573            // Exception-Check(s) to ensure that if any parameters which must adhere to a
574            // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
575            
576            BRDPC.checkIAE(
577                "type", type,
578                "global", "local", "with", "closure", "catch", "block", "script", "eval", "module", "wasm-expression-stack"
579            );
580            
581            this.type           = type;
582            this.object         = object;
583            this.name           = name;
584            this.startLocation  = startLocation;
585            this.endLocation    = endLocation;
586        }
587        
588        /**
589         * JSON Object Constructor
590         * @param jo A Json-Object having data about an instance of {@code 'Scope'}.
591         */
592        public Scope (JsonObject jo)
593        {
594            this.type           = ReadJSON.getString(jo, "type", false, true);
595            this.object         = ReadJSON.XL.getObject(jo, "object", RunTime.RemoteObject.class, false, true);
596            this.name           = ReadJSON.getString(jo, "name", true, false);
597            this.startLocation  = ReadJSON.XL.getObject(jo, "startLocation", Debugger.Location.class, true, false);
598            this.endLocation    = ReadJSON.XL.getObject(jo, "endLocation", Debugger.Location.class, true, false);
599        }
600        
601    }
602    
603    /** Search match for resource. */
604    public static class SearchMatch extends BaseType
605    {
606        /** For Object Serialization.  java.io.Serializable */
607        protected static final long serialVersionUID = 1;
608        
609        public boolean[] optionals()
610        { return new boolean[] { false, false, }; }
611        
612        /** Line number in resource content. */
613        public final Number lineNumber;
614        
615        /** Line with match content. */
616        public final String lineContent;
617        
618        /**
619         * Constructor
620         *
621         * @param lineNumber Line number in resource content.
622         * 
623         * @param lineContent Line with match content.
624         */
625        public SearchMatch(Number lineNumber, String lineContent)
626        {
627            // Exception-Check(s) to ensure that if any parameters which are not declared as
628            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
629            
630            if (lineNumber == null)  BRDPC.throwNPE("lineNumber");
631            if (lineContent == null) BRDPC.throwNPE("lineContent");
632            
633            this.lineNumber   = lineNumber;
634            this.lineContent  = lineContent;
635        }
636        
637        /**
638         * JSON Object Constructor
639         * @param jo A Json-Object having data about an instance of {@code 'SearchMatch'}.
640         */
641        public SearchMatch (JsonObject jo)
642        {
643            this.lineNumber   = ReadJSON.getNUMBER(jo, "lineNumber", false, true);
644            this.lineContent  = ReadJSON.getString(jo, "lineContent", false, true);
645        }
646        
647    }
648    
649    /** <CODE>[No Description Provided by Google]</CODE> */
650    public static class BreakLocation extends BaseType
651    {
652        /** For Object Serialization.  java.io.Serializable */
653        protected static final long serialVersionUID = 1;
654        
655        public boolean[] optionals()
656        { return new boolean[] { false, false, true, true, }; }
657        
658        /** Script identifier as reported in the <CODE>Debugger.scriptParsed</CODE>. */
659        public final String scriptId;
660        
661        /** Line number in the script (0-based). */
662        public final int lineNumber;
663        
664        /**
665         * Column number in the script (0-based).
666         * <BR />
667         * <BR /><B>OPTIONAL</B>
668         */
669        public final Integer columnNumber;
670        
671        /**
672         * <CODE>[No Description Provided by Google]</CODE>
673         * <BR />
674         * <BR /><B>OPTIONAL</B>
675         */
676        public final String type;
677        
678        /**
679         * Constructor
680         *
681         * @param scriptId Script identifier as reported in the <CODE>Debugger.scriptParsed</CODE>.
682         * 
683         * @param lineNumber Line number in the script (0-based).
684         * 
685         * @param columnNumber Column number in the script (0-based).
686         * <BR /><B>OPTIONAL</B>
687         * 
688         * @param type -
689         * <BR />Acceptable Values: ["debuggerStatement", "call", "return"]
690         * <BR /><B>OPTIONAL</B>
691         */
692        public BreakLocation(String scriptId, int lineNumber, Integer columnNumber, String type)
693        {
694            // Exception-Check(s) to ensure that if any parameters which are not declared as
695            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
696            
697            if (scriptId == null) BRDPC.throwNPE("scriptId");
698            
699            // Exception-Check(s) to ensure that if any parameters which must adhere to a
700            // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
701            
702            BRDPC.checkIAE(
703                "type", type,
704                "debuggerStatement", "call", "return"
705            );
706            
707            this.scriptId      = scriptId;
708            this.lineNumber    = lineNumber;
709            this.columnNumber  = columnNumber;
710            this.type          = type;
711        }
712        
713        /**
714         * JSON Object Constructor
715         * @param jo A Json-Object having data about an instance of {@code 'BreakLocation'}.
716         */
717        public BreakLocation (JsonObject jo)
718        {
719            this.scriptId      = ReadJSON.getString(jo, "scriptId", false, true);
720            this.lineNumber    = ReadJSON.getInt(jo, "lineNumber");
721            this.columnNumber  = ReadJSON.getINTEGER(jo, "columnNumber", true);
722            this.type          = ReadJSON.getString(jo, "type", true, false);
723        }
724        
725    }
726    
727    /** Debug symbols available for a wasm script. */
728    public static class DebugSymbols extends BaseType
729    {
730        /** For Object Serialization.  java.io.Serializable */
731        protected static final long serialVersionUID = 1;
732        
733        public boolean[] optionals()
734        { return new boolean[] { false, true, }; }
735        
736        /** Type of the debug symbols. */
737        public final String type;
738        
739        /**
740         * URL of the external symbol source.
741         * <BR />
742         * <BR /><B>OPTIONAL</B>
743         */
744        public final String externalURL;
745        
746        /**
747         * Constructor
748         *
749         * @param type Type of the debug symbols.
750         * <BR />Acceptable Values: ["None", "SourceMap", "EmbeddedDWARF", "ExternalDWARF"]
751         * 
752         * @param externalURL URL of the external symbol source.
753         * <BR /><B>OPTIONAL</B>
754         */
755        public DebugSymbols(String type, String externalURL)
756        {
757            // Exception-Check(s) to ensure that if any parameters which are not declared as
758            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
759            
760            if (type == null) BRDPC.throwNPE("type");
761            
762            // Exception-Check(s) to ensure that if any parameters which must adhere to a
763            // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
764            
765            BRDPC.checkIAE(
766                "type", type,
767                "None", "SourceMap", "EmbeddedDWARF", "ExternalDWARF"
768            );
769            
770            this.type         = type;
771            this.externalURL  = externalURL;
772        }
773        
774        /**
775         * JSON Object Constructor
776         * @param jo A Json-Object having data about an instance of {@code 'DebugSymbols'}.
777         */
778        public DebugSymbols (JsonObject jo)
779        {
780            this.type         = ReadJSON.getString(jo, "type", false, true);
781            this.externalURL  = ReadJSON.getString(jo, "externalURL", true, false);
782        }
783        
784    }
785    
786    /**
787     * Fired when the virtual machine resumed execution.
788     *
789     * <BR /><BR />This is Marker-Event.  Marker-Event's are Events that do not posses
790     * any data, fields or state.  When they are fired, only the event name is supplied.
791     */
792    public static class resumed extends BrowserEvent
793    {
794        /** For Object Serialization.  java.io.Serializable */
795        protected static final long serialVersionUID = 1;
796    
797        public boolean[] optionals() { return new boolean[0]; }
798    
799        /** JSON Object Constructor */
800        public resumed(JsonObject jo)
801        { super("Debugger", "resumed", 0); }
802    
803        @Override
804        public String toString() { return "Debugger.resumed Marker Event\n"; }
805    }
806    
807    /** Fired when breakpoint is resolved to an actual script and location. */
808    public static class breakpointResolved extends BrowserEvent
809    {
810        /** For Object Serialization.  java.io.Serializable */
811        protected static final long serialVersionUID = 1;
812        
813        public boolean[] optionals()
814        { return new boolean[] { false, false, }; }
815        
816        /** Breakpoint unique identifier. */
817        public final String breakpointId;
818        
819        /** Actual breakpoint location. */
820        public final Debugger.Location location;
821        
822        /**
823         * Constructor
824         *
825         * @param breakpointId Breakpoint unique identifier.
826         * 
827         * @param location Actual breakpoint location.
828         */
829        public breakpointResolved(String breakpointId, Debugger.Location location)
830        {
831            super("Debugger", "breakpointResolved", 2);
832            
833            // Exception-Check(s) to ensure that if any parameters which are not declared as
834            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
835            
836            if (breakpointId == null) BRDPC.throwNPE("breakpointId");
837            if (location == null)     BRDPC.throwNPE("location");
838            
839            this.breakpointId  = breakpointId;
840            this.location      = location;
841        }
842        
843        /**
844         * JSON Object Constructor
845         * @param jo A Json-Object having data about an instance of {@code 'breakpointResolved'}.
846         */
847        public breakpointResolved (JsonObject jo)
848        {
849            super("Debugger", "breakpointResolved", 2);
850        
851            this.breakpointId  = ReadJSON.getString(jo, "breakpointId", false, true);
852            this.location      = ReadJSON.XL.getObject(jo, "location", Debugger.Location.class, false, true);
853        }
854        
855    }
856    
857    /** Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. */
858    public static class paused extends BrowserEvent
859    {
860        /** For Object Serialization.  java.io.Serializable */
861        protected static final long serialVersionUID = 1;
862        
863        public boolean[] optionals()
864        { return new boolean[] { false, false, true, true, true, true, true, }; }
865        
866        /** Call stack the virtual machine stopped on. */
867        public final Debugger.CallFrame[] callFrames;
868        
869        /** Pause reason. */
870        public final String reason;
871        
872        /**
873         * Object containing break-specific auxiliary properties.
874         * <BR />
875         * <BR /><B>OPTIONAL</B>
876         */
877        public final JsonObject data;
878        
879        /**
880         * Hit breakpoints IDs
881         * <BR />
882         * <BR /><B>OPTIONAL</B>
883         */
884        public final String[] hitBreakpoints;
885        
886        /**
887         * Async stack trace, if any.
888         * <BR />
889         * <BR /><B>OPTIONAL</B>
890         */
891        public final RunTime.StackTrace asyncStackTrace;
892        
893        /**
894         * Async stack trace, if any.
895         * <BR />
896         * <BR /><B>OPTIONAL</B>
897         * <BR /><B>EXPERIMENTAL</B>
898         */
899        public final RunTime.StackTraceId asyncStackTraceId;
900        
901        /**
902         * Never present, will be removed.
903         * <BR />
904         * <BR /><B>OPTIONAL</B>
905         * <BR /><B>EXPERIMENTAL</B>
906         * <BR /><B>DEPRECATED</B>
907         */
908        public final RunTime.StackTraceId asyncCallStackTraceId;
909        
910        /**
911         * Constructor
912         *
913         * @param callFrames Call stack the virtual machine stopped on.
914         * 
915         * @param reason Pause reason.
916         * <BR />Acceptable Values: ["ambiguous", "assert", "CSPViolation", "debugCommand", "DOM", "EventListener", "exception", "instrumentation", "OOM", "other", "promiseRejection", "XHR"]
917         * 
918         * @param data Object containing break-specific auxiliary properties.
919         * <BR /><B>OPTIONAL</B>
920         * 
921         * @param hitBreakpoints Hit breakpoints IDs
922         * <BR /><B>OPTIONAL</B>
923         * 
924         * @param asyncStackTrace Async stack trace, if any.
925         * <BR /><B>OPTIONAL</B>
926         * 
927         * @param asyncStackTraceId Async stack trace, if any.
928         * <BR /><B>OPTIONAL</B>
929         * <BR /><B>EXPERIMENTAL</B>
930         * 
931         * @param asyncCallStackTraceId Never present, will be removed.
932         * <BR /><B>OPTIONAL</B>
933         * <BR /><B>EXPERIMENTAL</B>
934         * <BR /><B>DEPRECATED</B>
935         */
936        public paused(
937                Debugger.CallFrame[] callFrames, String reason, JsonObject data, 
938                String[] hitBreakpoints, RunTime.StackTrace asyncStackTrace, 
939                RunTime.StackTraceId asyncStackTraceId, RunTime.StackTraceId asyncCallStackTraceId
940            )
941        {
942            super("Debugger", "paused", 7);
943            
944            // Exception-Check(s) to ensure that if any parameters which are not declared as
945            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
946            
947            if (callFrames == null) BRDPC.throwNPE("callFrames");
948            if (reason == null)     BRDPC.throwNPE("reason");
949            
950            // Exception-Check(s) to ensure that if any parameters which must adhere to a
951            // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
952            
953            BRDPC.checkIAE(
954                "reason", reason,
955                "ambiguous", "assert", "CSPViolation", "debugCommand", "DOM", "EventListener", "exception", "instrumentation", "OOM", "other", "promiseRejection", "XHR"
956            );
957            
958            this.callFrames             = callFrames;
959            this.reason                 = reason;
960            this.data                   = data;
961            this.hitBreakpoints         = hitBreakpoints;
962            this.asyncStackTrace        = asyncStackTrace;
963            this.asyncStackTraceId      = asyncStackTraceId;
964            this.asyncCallStackTraceId  = asyncCallStackTraceId;
965        }
966        
967        /**
968         * JSON Object Constructor
969         * @param jo A Json-Object having data about an instance of {@code 'paused'}.
970         */
971        public paused (JsonObject jo)
972        {
973            super("Debugger", "paused", 7);
974        
975            this.callFrames             = (jo.getJsonArray("callFrames") == null)
976            ? null
977            : ReadArrJSON.DimN.objArr(jo.getJsonArray("callFrames"), null, 0, Debugger.CallFrame[].class);
978            this.reason                 = ReadJSON.getString(jo, "reason", false, true);
979            this.data                   = jo.getJsonObject("data");
980            this.hitBreakpoints         = (jo.getJsonArray("hitBreakpoints") == null)
981            ? null
982            : ReadArrJSON.DimN.strArr(jo.getJsonArray("hitBreakpoints"), null, 0, String[].class);
983            this.asyncStackTrace        = ReadJSON.XL.getObject(jo, "asyncStackTrace", RunTime.StackTrace.class, true, false);
984            this.asyncStackTraceId      = ReadJSON.XL.getObject(jo, "asyncStackTraceId", RunTime.StackTraceId.class, true, false);
985            this.asyncCallStackTraceId  = ReadJSON.XL.getObject(jo, "asyncCallStackTraceId", RunTime.StackTraceId.class, true, false);
986        }
987        
988    }
989    
990    /** Fired when virtual machine fails to parse the script. */
991    public static class scriptFailedToParse extends BrowserEvent
992    {
993        /** For Object Serialization.  java.io.Serializable */
994        protected static final long serialVersionUID = 1;
995        
996        public boolean[] optionals()
997        { return new boolean[] { false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, }; }
998        
999        /** Identifier of the script parsed. */
1000        public final String scriptId;
1001        
1002        /** URL or name of the script parsed (if any). */
1003        public final String url;
1004        
1005        /** Line offset of the script within the resource with given URL (for script tags). */
1006        public final int startLine;
1007        
1008        /** Column offset of the script within the resource with given URL. */
1009        public final int startColumn;
1010        
1011        /** Last line of the script. */
1012        public final int endLine;
1013        
1014        /** Length of the last line of the script. */
1015        public final int endColumn;
1016        
1017        /** Specifies script creation context. */
1018        public final int executionContextId;
1019        
1020        /** Content hash of the script. */
1021        public final String hash;
1022        
1023        /**
1024         * Embedder-specific auxiliary data.
1025         * <BR />
1026         * <BR /><B>OPTIONAL</B>
1027         */
1028        public final JsonObject executionContextAuxData;
1029        
1030        /**
1031         * URL of source map associated with script (if any).
1032         * <BR />
1033         * <BR /><B>OPTIONAL</B>
1034         */
1035        public final String sourceMapURL;
1036        
1037        /**
1038         * True, if this script has sourceURL.
1039         * <BR />
1040         * <BR /><B>OPTIONAL</B>
1041         */
1042        public final Boolean hasSourceURL;
1043        
1044        /**
1045         * True, if this script is ES6 module.
1046         * <BR />
1047         * <BR /><B>OPTIONAL</B>
1048         */
1049        public final Boolean isModule;
1050        
1051        /**
1052         * This script length.
1053         * <BR />
1054         * <BR /><B>OPTIONAL</B>
1055         */
1056        public final Integer length;
1057        
1058        /**
1059         * JavaScript top stack frame of where the script parsed event was triggered if available.
1060         * <BR />
1061         * <BR /><B>OPTIONAL</B>
1062         * <BR /><B>EXPERIMENTAL</B>
1063         */
1064        public final RunTime.StackTrace stackTrace;
1065        
1066        /**
1067         * If the scriptLanguage is WebAssembly, the code section offset in the module.
1068         * <BR />
1069         * <BR /><B>OPTIONAL</B>
1070         * <BR /><B>EXPERIMENTAL</B>
1071         */
1072        public final Integer codeOffset;
1073        
1074        /**
1075         * The language of the script.
1076         * <BR />
1077         * <BR /><B>OPTIONAL</B>
1078         * <BR /><B>EXPERIMENTAL</B>
1079         */
1080        public final String scriptLanguage;
1081        
1082        /**
1083         * The name the embedder supplied for this script.
1084         * <BR />
1085         * <BR /><B>OPTIONAL</B>
1086         * <BR /><B>EXPERIMENTAL</B>
1087         */
1088        public final String embedderName;
1089        
1090        /**
1091         * Constructor
1092         *
1093         * @param scriptId Identifier of the script parsed.
1094         * 
1095         * @param url URL or name of the script parsed (if any).
1096         * 
1097         * @param startLine Line offset of the script within the resource with given URL (for script tags).
1098         * 
1099         * @param startColumn Column offset of the script within the resource with given URL.
1100         * 
1101         * @param endLine Last line of the script.
1102         * 
1103         * @param endColumn Length of the last line of the script.
1104         * 
1105         * @param executionContextId Specifies script creation context.
1106         * 
1107         * @param hash Content hash of the script.
1108         * 
1109         * @param executionContextAuxData Embedder-specific auxiliary data.
1110         * <BR /><B>OPTIONAL</B>
1111         * 
1112         * @param sourceMapURL URL of source map associated with script (if any).
1113         * <BR /><B>OPTIONAL</B>
1114         * 
1115         * @param hasSourceURL True, if this script has sourceURL.
1116         * <BR /><B>OPTIONAL</B>
1117         * 
1118         * @param isModule True, if this script is ES6 module.
1119         * <BR /><B>OPTIONAL</B>
1120         * 
1121         * @param length This script length.
1122         * <BR /><B>OPTIONAL</B>
1123         * 
1124         * @param stackTrace JavaScript top stack frame of where the script parsed event was triggered if available.
1125         * <BR /><B>OPTIONAL</B>
1126         * <BR /><B>EXPERIMENTAL</B>
1127         * 
1128         * @param codeOffset If the scriptLanguage is WebAssembly, the code section offset in the module.
1129         * <BR /><B>OPTIONAL</B>
1130         * <BR /><B>EXPERIMENTAL</B>
1131         * 
1132         * @param scriptLanguage The language of the script.
1133         * <BR /><B>OPTIONAL</B>
1134         * <BR /><B>EXPERIMENTAL</B>
1135         * 
1136         * @param embedderName The name the embedder supplied for this script.
1137         * <BR /><B>OPTIONAL</B>
1138         * <BR /><B>EXPERIMENTAL</B>
1139         */
1140        public scriptFailedToParse(
1141                String scriptId, String url, int startLine, int startColumn, int endLine, 
1142                int endColumn, int executionContextId, String hash, 
1143                JsonObject executionContextAuxData, String sourceMapURL, Boolean hasSourceURL, 
1144                Boolean isModule, Integer length, RunTime.StackTrace stackTrace, Integer codeOffset, 
1145                String scriptLanguage, String embedderName
1146            )
1147        {
1148            super("Debugger", "scriptFailedToParse", 17);
1149            
1150            // Exception-Check(s) to ensure that if any parameters which are not declared as
1151            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1152            
1153            if (scriptId == null) BRDPC.throwNPE("scriptId");
1154            if (url == null)      BRDPC.throwNPE("url");
1155            if (hash == null)     BRDPC.throwNPE("hash");
1156            
1157            // Exception-Check(s) to ensure that if any parameters which must adhere to a
1158            // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
1159            
1160            BRDPC.checkIAE("scriptLanguage", scriptLanguage, "Debugger.ScriptLanguage", Debugger.ScriptLanguage);
1161            
1162            this.scriptId                 = scriptId;
1163            this.url                      = url;
1164            this.startLine                = startLine;
1165            this.startColumn              = startColumn;
1166            this.endLine                  = endLine;
1167            this.endColumn                = endColumn;
1168            this.executionContextId       = executionContextId;
1169            this.hash                     = hash;
1170            this.executionContextAuxData  = executionContextAuxData;
1171            this.sourceMapURL             = sourceMapURL;
1172            this.hasSourceURL             = hasSourceURL;
1173            this.isModule                 = isModule;
1174            this.length                   = length;
1175            this.stackTrace               = stackTrace;
1176            this.codeOffset               = codeOffset;
1177            this.scriptLanguage           = scriptLanguage;
1178            this.embedderName             = embedderName;
1179        }
1180        
1181        /**
1182         * JSON Object Constructor
1183         * @param jo A Json-Object having data about an instance of {@code 'scriptFailedToParse'}.
1184         */
1185        public scriptFailedToParse (JsonObject jo)
1186        {
1187            super("Debugger", "scriptFailedToParse", 17);
1188        
1189            this.scriptId                 = ReadJSON.getString(jo, "scriptId", false, true);
1190            this.url                      = ReadJSON.getString(jo, "url", false, true);
1191            this.startLine                = ReadJSON.getInt(jo, "startLine");
1192            this.startColumn              = ReadJSON.getInt(jo, "startColumn");
1193            this.endLine                  = ReadJSON.getInt(jo, "endLine");
1194            this.endColumn                = ReadJSON.getInt(jo, "endColumn");
1195            this.executionContextId       = ReadJSON.getInt(jo, "executionContextId");
1196            this.hash                     = ReadJSON.getString(jo, "hash", false, true);
1197            this.executionContextAuxData  = jo.getJsonObject("executionContextAuxData");
1198            this.sourceMapURL             = ReadJSON.getString(jo, "sourceMapURL", true, false);
1199            this.hasSourceURL             = ReadJSON.getBOOLEAN(jo, "hasSourceURL", true);
1200            this.isModule                 = ReadJSON.getBOOLEAN(jo, "isModule", true);
1201            this.length                   = ReadJSON.getINTEGER(jo, "length", true);
1202            this.stackTrace               = ReadJSON.XL.getObject(jo, "stackTrace", RunTime.StackTrace.class, true, false);
1203            this.codeOffset               = ReadJSON.getINTEGER(jo, "codeOffset", true);
1204            this.scriptLanguage           = ReadJSON.getString(jo, "scriptLanguage", true, false);
1205            this.embedderName             = ReadJSON.getString(jo, "embedderName", true, false);
1206        }
1207        
1208    }
1209    
1210    /**
1211     * Fired when virtual machine parses script. This event is also fired for all known and uncollected
1212     * scripts upon enabling debugger.
1213     */
1214    public static class scriptParsed extends BrowserEvent
1215    {
1216        /** For Object Serialization.  java.io.Serializable */
1217        protected static final long serialVersionUID = 1;
1218        
1219        public boolean[] optionals()
1220        { return new boolean[] { false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, }; }
1221        
1222        /** Identifier of the script parsed. */
1223        public final String scriptId;
1224        
1225        /** URL or name of the script parsed (if any). */
1226        public final String url;
1227        
1228        /** Line offset of the script within the resource with given URL (for script tags). */
1229        public final int startLine;
1230        
1231        /** Column offset of the script within the resource with given URL. */
1232        public final int startColumn;
1233        
1234        /** Last line of the script. */
1235        public final int endLine;
1236        
1237        /** Length of the last line of the script. */
1238        public final int endColumn;
1239        
1240        /** Specifies script creation context. */
1241        public final int executionContextId;
1242        
1243        /** Content hash of the script. */
1244        public final String hash;
1245        
1246        /**
1247         * Embedder-specific auxiliary data.
1248         * <BR />
1249         * <BR /><B>OPTIONAL</B>
1250         */
1251        public final JsonObject executionContextAuxData;
1252        
1253        /**
1254         * True, if this script is generated as a result of the live edit operation.
1255         * <BR />
1256         * <BR /><B>OPTIONAL</B>
1257         * <BR /><B>EXPERIMENTAL</B>
1258         */
1259        public final Boolean isLiveEdit;
1260        
1261        /**
1262         * URL of source map associated with script (if any).
1263         * <BR />
1264         * <BR /><B>OPTIONAL</B>
1265         */
1266        public final String sourceMapURL;
1267        
1268        /**
1269         * True, if this script has sourceURL.
1270         * <BR />
1271         * <BR /><B>OPTIONAL</B>
1272         */
1273        public final Boolean hasSourceURL;
1274        
1275        /**
1276         * True, if this script is ES6 module.
1277         * <BR />
1278         * <BR /><B>OPTIONAL</B>
1279         */
1280        public final Boolean isModule;
1281        
1282        /**
1283         * This script length.
1284         * <BR />
1285         * <BR /><B>OPTIONAL</B>
1286         */
1287        public final Integer length;
1288        
1289        /**
1290         * JavaScript top stack frame of where the script parsed event was triggered if available.
1291         * <BR />
1292         * <BR /><B>OPTIONAL</B>
1293         * <BR /><B>EXPERIMENTAL</B>
1294         */
1295        public final RunTime.StackTrace stackTrace;
1296        
1297        /**
1298         * If the scriptLanguage is WebAssembly, the code section offset in the module.
1299         * <BR />
1300         * <BR /><B>OPTIONAL</B>
1301         * <BR /><B>EXPERIMENTAL</B>
1302         */
1303        public final Integer codeOffset;
1304        
1305        /**
1306         * The language of the script.
1307         * <BR />
1308         * <BR /><B>OPTIONAL</B>
1309         * <BR /><B>EXPERIMENTAL</B>
1310         */
1311        public final String scriptLanguage;
1312        
1313        /**
1314         * If the scriptLanguage is WebASsembly, the source of debug symbols for the module.
1315         * <BR />
1316         * <BR /><B>OPTIONAL</B>
1317         * <BR /><B>EXPERIMENTAL</B>
1318         */
1319        public final Debugger.DebugSymbols debugSymbols;
1320        
1321        /**
1322         * The name the embedder supplied for this script.
1323         * <BR />
1324         * <BR /><B>OPTIONAL</B>
1325         * <BR /><B>EXPERIMENTAL</B>
1326         */
1327        public final String embedderName;
1328        
1329        /**
1330         * Constructor
1331         *
1332         * @param scriptId Identifier of the script parsed.
1333         * 
1334         * @param url URL or name of the script parsed (if any).
1335         * 
1336         * @param startLine Line offset of the script within the resource with given URL (for script tags).
1337         * 
1338         * @param startColumn Column offset of the script within the resource with given URL.
1339         * 
1340         * @param endLine Last line of the script.
1341         * 
1342         * @param endColumn Length of the last line of the script.
1343         * 
1344         * @param executionContextId Specifies script creation context.
1345         * 
1346         * @param hash Content hash of the script.
1347         * 
1348         * @param executionContextAuxData Embedder-specific auxiliary data.
1349         * <BR /><B>OPTIONAL</B>
1350         * 
1351         * @param isLiveEdit True, if this script is generated as a result of the live edit operation.
1352         * <BR /><B>OPTIONAL</B>
1353         * <BR /><B>EXPERIMENTAL</B>
1354         * 
1355         * @param sourceMapURL URL of source map associated with script (if any).
1356         * <BR /><B>OPTIONAL</B>
1357         * 
1358         * @param hasSourceURL True, if this script has sourceURL.
1359         * <BR /><B>OPTIONAL</B>
1360         * 
1361         * @param isModule True, if this script is ES6 module.
1362         * <BR /><B>OPTIONAL</B>
1363         * 
1364         * @param length This script length.
1365         * <BR /><B>OPTIONAL</B>
1366         * 
1367         * @param stackTrace JavaScript top stack frame of where the script parsed event was triggered if available.
1368         * <BR /><B>OPTIONAL</B>
1369         * <BR /><B>EXPERIMENTAL</B>
1370         * 
1371         * @param codeOffset If the scriptLanguage is WebAssembly, the code section offset in the module.
1372         * <BR /><B>OPTIONAL</B>
1373         * <BR /><B>EXPERIMENTAL</B>
1374         * 
1375         * @param scriptLanguage The language of the script.
1376         * <BR /><B>OPTIONAL</B>
1377         * <BR /><B>EXPERIMENTAL</B>
1378         * 
1379         * @param debugSymbols If the scriptLanguage is WebASsembly, the source of debug symbols for the module.
1380         * <BR /><B>OPTIONAL</B>
1381         * <BR /><B>EXPERIMENTAL</B>
1382         * 
1383         * @param embedderName The name the embedder supplied for this script.
1384         * <BR /><B>OPTIONAL</B>
1385         * <BR /><B>EXPERIMENTAL</B>
1386         */
1387        public scriptParsed(
1388                String scriptId, String url, int startLine, int startColumn, int endLine, 
1389                int endColumn, int executionContextId, String hash, 
1390                JsonObject executionContextAuxData, Boolean isLiveEdit, String sourceMapURL, 
1391                Boolean hasSourceURL, Boolean isModule, Integer length, 
1392                RunTime.StackTrace stackTrace, Integer codeOffset, String scriptLanguage, 
1393                Debugger.DebugSymbols debugSymbols, String embedderName
1394            )
1395        {
1396            super("Debugger", "scriptParsed", 19);
1397            
1398            // Exception-Check(s) to ensure that if any parameters which are not declared as
1399            // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1400            
1401            if (scriptId == null) BRDPC.throwNPE("scriptId");
1402            if (url == null)      BRDPC.throwNPE("url");
1403            if (hash == null)     BRDPC.throwNPE("hash");
1404            
1405            // Exception-Check(s) to ensure that if any parameters which must adhere to a
1406            // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
1407            
1408            BRDPC.checkIAE("scriptLanguage", scriptLanguage, "Debugger.ScriptLanguage", Debugger.ScriptLanguage);
1409            
1410            this.scriptId                 = scriptId;
1411            this.url                      = url;
1412            this.startLine                = startLine;
1413            this.startColumn              = startColumn;
1414            this.endLine                  = endLine;
1415            this.endColumn                = endColumn;
1416            this.executionContextId       = executionContextId;
1417            this.hash                     = hash;
1418            this.executionContextAuxData  = executionContextAuxData;
1419            this.isLiveEdit               = isLiveEdit;
1420            this.sourceMapURL             = sourceMapURL;
1421            this.hasSourceURL             = hasSourceURL;
1422            this.isModule                 = isModule;
1423            this.length                   = length;
1424            this.stackTrace               = stackTrace;
1425            this.codeOffset               = codeOffset;
1426            this.scriptLanguage           = scriptLanguage;
1427            this.debugSymbols             = debugSymbols;
1428            this.embedderName             = embedderName;
1429        }
1430        
1431        /**
1432         * JSON Object Constructor
1433         * @param jo A Json-Object having data about an instance of {@code 'scriptParsed'}.
1434         */
1435        public scriptParsed (JsonObject jo)
1436        {
1437            super("Debugger", "scriptParsed", 19);
1438        
1439            this.scriptId                 = ReadJSON.getString(jo, "scriptId", false, true);
1440            this.url                      = ReadJSON.getString(jo, "url", false, true);
1441            this.startLine                = ReadJSON.getInt(jo, "startLine");
1442            this.startColumn              = ReadJSON.getInt(jo, "startColumn");
1443            this.endLine                  = ReadJSON.getInt(jo, "endLine");
1444            this.endColumn                = ReadJSON.getInt(jo, "endColumn");
1445            this.executionContextId       = ReadJSON.getInt(jo, "executionContextId");
1446            this.hash                     = ReadJSON.getString(jo, "hash", false, true);
1447            this.executionContextAuxData  = jo.getJsonObject("executionContextAuxData");
1448            this.isLiveEdit               = ReadJSON.getBOOLEAN(jo, "isLiveEdit", true);
1449            this.sourceMapURL             = ReadJSON.getString(jo, "sourceMapURL", true, false);
1450            this.hasSourceURL             = ReadJSON.getBOOLEAN(jo, "hasSourceURL", true);
1451            this.isModule                 = ReadJSON.getBOOLEAN(jo, "isModule", true);
1452            this.length                   = ReadJSON.getINTEGER(jo, "length", true);
1453            this.stackTrace               = ReadJSON.XL.getObject(jo, "stackTrace", RunTime.StackTrace.class, true, false);
1454            this.codeOffset               = ReadJSON.getINTEGER(jo, "codeOffset", true);
1455            this.scriptLanguage           = ReadJSON.getString(jo, "scriptLanguage", true, false);
1456            this.debugSymbols             = ReadJSON.XL.getObject(jo, "debugSymbols", Debugger.DebugSymbols.class, true, false);
1457            this.embedderName             = ReadJSON.getString(jo, "embedderName", true, false);
1458        }
1459        
1460    }
1461    
1462    
1463    // Counter for keeping the WebSocket Request ID's distinct.
1464    private static int counter = 1;
1465    
1466    /**
1467     * Continues execution until specific location is reached.
1468     * 
1469     * @param location Location to continue to.
1470     * 
1471     * @param targetCallFrames -
1472     * <BR />Acceptable Values: ["any", "current"]
1473     * <BR /><B>OPTIONAL</B>
1474     * 
1475     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1476     * {@link Ret0}&gt;</CODE>
1477     *
1478     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1479     * browser receives the invocation-request.
1480     *
1481     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1482     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1483     * {@code >} to ensure the Browser Function has run to completion.
1484     */
1485    public static Script<String, JsonObject, Ret0> continueToLocation
1486        (Debugger.Location location, String targetCallFrames)
1487    {
1488        // Exception-Check(s) to ensure that if any parameters which are not declared as
1489        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1490        
1491        if (location == null) BRDPC.throwNPE("location");
1492        
1493        // Exception-Check(s) to ensure that if any parameters which must adhere to a
1494        // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
1495        
1496        BRDPC.checkIAE(
1497            "targetCallFrames", targetCallFrames,
1498            "any", "current"
1499        );
1500        
1501        final int       webSocketID = 2000000 + counter++;
1502        final boolean[] optionals   = { false, true, };
1503        
1504        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1505        String requestJSON = WriteJSON.get(
1506            parameterTypes.get("continueToLocation"),
1507            parameterNames.get("continueToLocation"),
1508            optionals, webSocketID,
1509            "Debugger.continueToLocation",
1510            location, targetCallFrames
1511        );
1512        
1513        // This Remote Command does not have a Return-Value.
1514        return new Script<>
1515            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
1516    }
1517    
1518    /**
1519     * Disables debugger for given page.
1520     * 
1521     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1522     * {@link Ret0}&gt;</CODE>
1523     *
1524     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1525     * browser receives the invocation-request.
1526     *
1527     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1528     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1529     * {@code >} to ensure the Browser Function has run to completion.
1530     */
1531    public static Script<String, JsonObject, Ret0> disable()
1532    {
1533        final int          webSocketID = 2001000 + counter++;
1534        final boolean[]    optionals   = new boolean[0];
1535        
1536        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1537        String requestJSON = WriteJSON.get(
1538            parameterTypes.get("disable"),
1539            parameterNames.get("disable"),
1540            optionals, webSocketID,
1541            "Debugger.disable"
1542        );
1543        
1544        // This Remote Command does not have a Return-Value.
1545        return new Script<>
1546            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
1547    }
1548    
1549    /**
1550     * Enables debugger for the given page. Clients should not assume that the debugging has been
1551     * enabled until the result for this command is received.
1552     * 
1553     * @param maxScriptsCacheSize 
1554     * The maximum size in bytes of collected scripts (not referenced by other heap objects)
1555     * the debugger can hold. Puts no limit if parameter is omitted.
1556     * <BR /><B>OPTIONAL</B>
1557     * <BR /><B>EXPERIMENTAL</B>
1558     * 
1559     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1560     * String&gt;</CODE>
1561     * 
1562     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
1563     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
1564     * String&gt;</CODE> will be returned.
1565     *
1566     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
1567     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
1568      * may be retrieved.</I>
1569     *
1570     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
1571     * <BR /><BR /><UL CLASS=JDUL>
1572     * <LI><CODE>String (<B>debuggerId</B></CODE>)
1573     *     <BR />Unique identifier of the debugger.
1574     * </LI>
1575     * </UL> */
1576    public static Script<String, JsonObject, String> enable(Number maxScriptsCacheSize)
1577    {
1578        final int       webSocketID = 2002000 + counter++;
1579        final boolean[] optionals   = { true, };
1580        
1581        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1582        String requestJSON = WriteJSON.get(
1583            parameterTypes.get("enable"),
1584            parameterNames.get("enable"),
1585            optionals, webSocketID,
1586            "Debugger.enable",
1587            maxScriptsCacheSize
1588        );
1589        
1590        // 'JSON Binding' ... Converts Browser Response-JSON to 'String'
1591        Function<JsonObject, String> responseProcessor = (JsonObject jo) ->
1592            ReadJSON.getString(jo, "debuggerId", false, true);
1593        
1594        // Pass the 'defaultSender' to Script-Constructor
1595        // The sender that is used can be changed before executing script.
1596        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
1597    }
1598    
1599    /**
1600     * Evaluates expression on a given call frame.
1601     * 
1602     * @param callFrameId Call frame identifier to evaluate on.
1603     * 
1604     * @param expression Expression to evaluate.
1605     * 
1606     * @param objectGroup 
1607     * String object group name to put result into (allows rapid releasing resulting object handles
1608     * using <CODE>releaseObjectGroup</CODE>).
1609     * <BR /><B>OPTIONAL</B>
1610     * 
1611     * @param includeCommandLineAPI 
1612     * Specifies whether command line API should be available to the evaluated expression, defaults
1613     * to false.
1614     * <BR /><B>OPTIONAL</B>
1615     * 
1616     * @param silent 
1617     * In silent mode exceptions thrown during evaluation are not reported and do not pause
1618     * execution. Overrides <CODE>setPauseOnException</CODE> state.
1619     * <BR /><B>OPTIONAL</B>
1620     * 
1621     * @param returnByValue Whether the result is expected to be a JSON object that should be sent by value.
1622     * <BR /><B>OPTIONAL</B>
1623     * 
1624     * @param generatePreview Whether preview should be generated for the result.
1625     * <BR /><B>OPTIONAL</B>
1626     * <BR /><B>EXPERIMENTAL</B>
1627     * 
1628     * @param throwOnSideEffect Whether to throw an exception if side effect cannot be ruled out during evaluation.
1629     * <BR /><B>OPTIONAL</B>
1630     * 
1631     * @param timeout Terminate execution after timing out (number of milliseconds).
1632     * <BR /><B>OPTIONAL</B>
1633     * <BR /><B>EXPERIMENTAL</B>
1634     * 
1635     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1636     * {@link Ret2}&gt;</CODE>
1637     *
1638     * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 
1639     * {@link Script#exec()}), and a {@link Promise} returned.
1640     *
1641     * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B>
1642     * (using {@link Promise#await()}), the {@code Ret2} will subsequently
1643     * be returned from that call.
1644     * 
1645     * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated
1646     * in an instance of <B>{@link Ret2}</B>
1647     *
1648     * <BR /><BR /><UL CLASS=JDUL>
1649     * <LI><CODE><B>Ret2.a:</B> {@link RunTime.RemoteObject} (<B>result</B>)</CODE>
1650     *     <BR />Object wrapper for the evaluation result.
1651     *     <BR /><BR /></LI>
1652     * <LI><CODE><B>Ret2.b:</B> {@link RunTime.ExceptionDetails} (<B>exceptionDetails</B>)</CODE>
1653     *     <BR />Exception details.
1654     *     </LI>
1655     * </UL>
1656     */
1657    public static Script<String, JsonObject, Ret2<RunTime.RemoteObject, RunTime.ExceptionDetails>> evaluateOnCallFrame(
1658            String callFrameId, String expression, String objectGroup, 
1659            Boolean includeCommandLineAPI, Boolean silent, Boolean returnByValue, 
1660            Boolean generatePreview, Boolean throwOnSideEffect, Number timeout
1661        )
1662    {
1663        // Exception-Check(s) to ensure that if any parameters which are not declared as
1664        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1665        
1666        if (callFrameId == null) BRDPC.throwNPE("callFrameId");
1667        if (expression == null)  BRDPC.throwNPE("expression");
1668        
1669        final int       webSocketID = 2003000 + counter++;
1670        final boolean[] optionals   = { false, false, true, true, true, true, true, true, true, };
1671        
1672        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1673        String requestJSON = WriteJSON.get(
1674            parameterTypes.get("evaluateOnCallFrame"),
1675            parameterNames.get("evaluateOnCallFrame"),
1676            optionals, webSocketID,
1677            "Debugger.evaluateOnCallFrame",
1678            callFrameId, expression, objectGroup, includeCommandLineAPI, silent, returnByValue,
1679            generatePreview, throwOnSideEffect, timeout
1680        );
1681        
1682        // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2'
1683        Function<JsonObject, Ret2<RunTime.RemoteObject, RunTime.ExceptionDetails>> 
1684            responseProcessor = (JsonObject jo) -> new Ret2<>(
1685                ReadJSON.XL.getObject(jo, "result", RunTime.RemoteObject.class, false, true),
1686                ReadJSON.XL.getObject(jo, "exceptionDetails", RunTime.ExceptionDetails.class, true, false)
1687            );
1688        
1689        // Pass the 'defaultSender' to Script-Constructor
1690        // The sender that is used can be changed before executing script.
1691        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
1692    }
1693    
1694    /**
1695     * Returns possible locations for breakpoint. scriptId in start and end range locations should be
1696     * the same.
1697     * 
1698     * @param start Start of range to search possible breakpoint locations in.
1699     * 
1700     * @param end 
1701     * End of range to search possible breakpoint locations in (excluding). When not specified, end
1702     * of scripts is used as end of range.
1703     * <BR /><B>OPTIONAL</B>
1704     * 
1705     * @param restrictToFunction Only consider locations which are in the same (non-nested) function as start.
1706     * <BR /><B>OPTIONAL</B>
1707     * 
1708     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1709     * {@link Debugger.BreakLocation}[]&gt;</CODE>
1710     * 
1711     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
1712     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
1713     * {@link Debugger.BreakLocation}[]&gt;</CODE> will be returned.
1714     *
1715     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
1716     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
1717      * may be retrieved.</I>
1718     *
1719     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
1720     * <BR /><BR /><UL CLASS=JDUL>
1721     * <LI><CODE>{@link Debugger.BreakLocation}[] (<B>locations</B></CODE>)
1722     *     <BR />List of the possible breakpoint locations.
1723     * </LI>
1724     * </UL> */
1725    public static Script<String, JsonObject, Debugger.BreakLocation[]> getPossibleBreakpoints
1726        (Debugger.Location start, Debugger.Location end, Boolean restrictToFunction)
1727    {
1728        // Exception-Check(s) to ensure that if any parameters which are not declared as
1729        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1730        
1731        if (start == null) BRDPC.throwNPE("start");
1732        
1733        final int       webSocketID = 2004000 + counter++;
1734        final boolean[] optionals   = { false, true, true, };
1735        
1736        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1737        String requestJSON = WriteJSON.get(
1738            parameterTypes.get("getPossibleBreakpoints"),
1739            parameterNames.get("getPossibleBreakpoints"),
1740            optionals, webSocketID,
1741            "Debugger.getPossibleBreakpoints",
1742            start, end, restrictToFunction
1743        );
1744        
1745        // 'JSON Binding' ... Converts Browser Response-JSON to 'Debugger.BreakLocation[]'
1746        Function<JsonObject, Debugger.BreakLocation[]> responseProcessor = (JsonObject jo) ->
1747            (jo.getJsonArray("locations") == null)
1748                ? null
1749                : ReadArrJSON.DimN.objArr(jo.getJsonArray("locations"), null, 0, Debugger.BreakLocation[].class);
1750        
1751        // Pass the 'defaultSender' to Script-Constructor
1752        // The sender that is used can be changed before executing script.
1753        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
1754    }
1755    
1756    /**
1757     * Returns source for the script with given id.
1758     * 
1759     * @param scriptId Id of the script to get source for.
1760     * 
1761     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1762     * {@link Ret2}&gt;</CODE>
1763     *
1764     * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 
1765     * {@link Script#exec()}), and a {@link Promise} returned.
1766     *
1767     * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B>
1768     * (using {@link Promise#await()}), the {@code Ret2} will subsequently
1769     * be returned from that call.
1770     * 
1771     * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated
1772     * in an instance of <B>{@link Ret2}</B>
1773     *
1774     * <BR /><BR /><UL CLASS=JDUL>
1775     * <LI><CODE><B>Ret2.a:</B> String (<B>scriptSource</B>)</CODE>
1776     *     <BR />Script source (empty in case of Wasm bytecode).
1777     *     <BR /><BR /></LI>
1778     * <LI><CODE><B>Ret2.b:</B> String (<B>bytecode</B>)</CODE>
1779     *     <BR />Wasm bytecode. (Encoded as a base64 string when passed over JSON)
1780     *     </LI>
1781     * </UL>
1782     */
1783    public static Script<String, JsonObject, Ret2<String, String>> getScriptSource
1784        (String scriptId)
1785    {
1786        // Exception-Check(s) to ensure that if any parameters which are not declared as
1787        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1788        
1789        if (scriptId == null) BRDPC.throwNPE("scriptId");
1790        
1791        final int       webSocketID = 2005000 + counter++;
1792        final boolean[] optionals   = { false, };
1793        
1794        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1795        String requestJSON = WriteJSON.get(
1796            parameterTypes.get("getScriptSource"),
1797            parameterNames.get("getScriptSource"),
1798            optionals, webSocketID,
1799            "Debugger.getScriptSource",
1800            scriptId
1801        );
1802        
1803        // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2'
1804        Function<JsonObject, Ret2<String, String>> 
1805            responseProcessor = (JsonObject jo) -> new Ret2<>(
1806                ReadJSON.getString(jo, "scriptSource", false, true),
1807                ReadJSON.getString(jo, "bytecode", true, false)
1808            );
1809        
1810        // Pass the 'defaultSender' to Script-Constructor
1811        // The sender that is used can be changed before executing script.
1812        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
1813    }
1814    
1815    /**
1816     * This command is deprecated. Use getScriptSource instead.
1817     * <BR /><B>DEPRECATED</B>
1818     * 
1819     * @param scriptId Id of the Wasm script to get source for.
1820     * 
1821     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1822     * String&gt;</CODE>
1823     * 
1824     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
1825     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
1826     * String&gt;</CODE> will be returned.
1827     *
1828     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
1829     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
1830      * may be retrieved.</I>
1831     *
1832     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
1833     * <BR /><BR /><UL CLASS=JDUL>
1834     * <LI><CODE>String (<B>bytecode</B></CODE>)
1835     *     <BR />Script source. (Encoded as a base64 string when passed over JSON)
1836     * </LI>
1837     * </UL> */
1838    public static Script<String, JsonObject, String> getWasmBytecode(String scriptId)
1839    {
1840        // Exception-Check(s) to ensure that if any parameters which are not declared as
1841        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1842        
1843        if (scriptId == null) BRDPC.throwNPE("scriptId");
1844        
1845        final int       webSocketID = 2006000 + counter++;
1846        final boolean[] optionals   = { false, };
1847        
1848        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1849        String requestJSON = WriteJSON.get(
1850            parameterTypes.get("getWasmBytecode"),
1851            parameterNames.get("getWasmBytecode"),
1852            optionals, webSocketID,
1853            "Debugger.getWasmBytecode",
1854            scriptId
1855        );
1856        
1857        // 'JSON Binding' ... Converts Browser Response-JSON to 'String'
1858        Function<JsonObject, String> responseProcessor = (JsonObject jo) ->
1859            ReadJSON.getString(jo, "bytecode", false, true);
1860        
1861        // Pass the 'defaultSender' to Script-Constructor
1862        // The sender that is used can be changed before executing script.
1863        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
1864    }
1865    
1866    /**
1867     * Returns stack trace with given <CODE>stackTraceId</CODE>.
1868     * <BR /><B>EXPERIMENTAL</B>
1869     * 
1870     * @param stackTraceId -
1871     * 
1872     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1873     * {@link RunTime.StackTrace}&gt;</CODE>
1874     * 
1875     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
1876     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
1877     * {@link RunTime.StackTrace}&gt;</CODE> will be returned.
1878     *
1879     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
1880     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
1881      * may be retrieved.</I>
1882     *
1883     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
1884     * <BR /><BR /><UL CLASS=JDUL>
1885     * <LI><CODE>{@link RunTime.StackTrace} (<B>stackTrace</B></CODE>)
1886     *     <BR />-
1887     * </LI>
1888     * </UL> */
1889    public static Script<String, JsonObject, RunTime.StackTrace> getStackTrace
1890        (RunTime.StackTraceId stackTraceId)
1891    {
1892        // Exception-Check(s) to ensure that if any parameters which are not declared as
1893        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1894        
1895        if (stackTraceId == null) BRDPC.throwNPE("stackTraceId");
1896        
1897        final int       webSocketID = 2007000 + counter++;
1898        final boolean[] optionals   = { false, };
1899        
1900        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1901        String requestJSON = WriteJSON.get(
1902            parameterTypes.get("getStackTrace"),
1903            parameterNames.get("getStackTrace"),
1904            optionals, webSocketID,
1905            "Debugger.getStackTrace",
1906            stackTraceId
1907        );
1908        
1909        // 'JSON Binding' ... Converts Browser Response-JSON to 'RunTime.StackTrace'
1910        Function<JsonObject, RunTime.StackTrace> responseProcessor = (JsonObject jo) ->
1911            ReadJSON.XL.getObject(jo, "stackTrace", RunTime.StackTrace.class, false, true);
1912        
1913        // Pass the 'defaultSender' to Script-Constructor
1914        // The sender that is used can be changed before executing script.
1915        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
1916    }
1917    
1918    /**
1919     * Stops on the next JavaScript statement.
1920     * 
1921     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1922     * {@link Ret0}&gt;</CODE>
1923     *
1924     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1925     * browser receives the invocation-request.
1926     *
1927     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1928     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1929     * {@code >} to ensure the Browser Function has run to completion.
1930     */
1931    public static Script<String, JsonObject, Ret0> pause()
1932    {
1933        final int          webSocketID = 2008000 + counter++;
1934        final boolean[]    optionals   = new boolean[0];
1935        
1936        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1937        String requestJSON = WriteJSON.get(
1938            parameterTypes.get("pause"),
1939            parameterNames.get("pause"),
1940            optionals, webSocketID,
1941            "Debugger.pause"
1942        );
1943        
1944        // This Remote Command does not have a Return-Value.
1945        return new Script<>
1946            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
1947    }
1948    
1949    /**
1950     * <CODE>[No Description Provided by Google]</CODE>
1951     * <BR /><B>EXPERIMENTAL</B>
1952     * <BR /><B>DEPRECATED</B>
1953     * 
1954     * @param parentStackTraceId Debugger will pause when async call with given stack trace is started.
1955     * 
1956     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1957     * {@link Ret0}&gt;</CODE>
1958     *
1959     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
1960     * browser receives the invocation-request.
1961     *
1962     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
1963     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
1964     * {@code >} to ensure the Browser Function has run to completion.
1965     */
1966    public static Script<String, JsonObject, Ret0> pauseOnAsyncCall
1967        (RunTime.StackTraceId parentStackTraceId)
1968    {
1969        // Exception-Check(s) to ensure that if any parameters which are not declared as
1970        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
1971        
1972        if (parentStackTraceId == null) BRDPC.throwNPE("parentStackTraceId");
1973        
1974        final int       webSocketID = 2009000 + counter++;
1975        final boolean[] optionals   = { false, };
1976        
1977        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
1978        String requestJSON = WriteJSON.get(
1979            parameterTypes.get("pauseOnAsyncCall"),
1980            parameterNames.get("pauseOnAsyncCall"),
1981            optionals, webSocketID,
1982            "Debugger.pauseOnAsyncCall",
1983            parentStackTraceId
1984        );
1985        
1986        // This Remote Command does not have a Return-Value.
1987        return new Script<>
1988            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
1989    }
1990    
1991    /**
1992     * Removes JavaScript breakpoint.
1993     * 
1994     * @param breakpointId -
1995     * 
1996     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
1997     * {@link Ret0}&gt;</CODE>
1998     *
1999     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2000     * browser receives the invocation-request.
2001     *
2002     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2003     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2004     * {@code >} to ensure the Browser Function has run to completion.
2005     */
2006    public static Script<String, JsonObject, Ret0> removeBreakpoint(String breakpointId)
2007    {
2008        // Exception-Check(s) to ensure that if any parameters which are not declared as
2009        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2010        
2011        if (breakpointId == null) BRDPC.throwNPE("breakpointId");
2012        
2013        final int       webSocketID = 2010000 + counter++;
2014        final boolean[] optionals   = { false, };
2015        
2016        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2017        String requestJSON = WriteJSON.get(
2018            parameterTypes.get("removeBreakpoint"),
2019            parameterNames.get("removeBreakpoint"),
2020            optionals, webSocketID,
2021            "Debugger.removeBreakpoint",
2022            breakpointId
2023        );
2024        
2025        // This Remote Command does not have a Return-Value.
2026        return new Script<>
2027            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2028    }
2029    
2030    /**
2031     * Restarts particular call frame from the beginning.
2032     * <BR /><B>DEPRECATED</B>
2033     * 
2034     * @param callFrameId Call frame identifier to evaluate on.
2035     * 
2036     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2037     * {@link Ret3}&gt;</CODE>
2038     *
2039     * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 
2040     * {@link Script#exec()}), and a {@link Promise} returned.
2041     *
2042     * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B>
2043     * (using {@link Promise#await()}), the {@code Ret3} will subsequently
2044     * be returned from that call.
2045     * 
2046     * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated
2047     * in an instance of <B>{@link Ret3}</B>
2048     *
2049     * <BR /><BR /><UL CLASS=JDUL>
2050     * <LI><CODE><B>Ret3.a:</B> {@link Debugger.CallFrame}[] (<B>callFrames</B>)</CODE>
2051     *     <BR />New stack trace.
2052     *     <BR /><BR /></LI>
2053     * <LI><CODE><B>Ret3.b:</B> {@link RunTime.StackTrace} (<B>asyncStackTrace</B>)</CODE>
2054     *     <BR />Async stack trace, if any.
2055     *     <BR /><BR /></LI>
2056     * <LI><CODE><B>Ret3.c:</B> {@link RunTime.StackTraceId} (<B>asyncStackTraceId</B>)</CODE>
2057     *     <BR />Async stack trace, if any.
2058     *     </LI>
2059     * </UL>
2060     */
2061    public static Script<String, JsonObject, Ret3<Debugger.CallFrame[], RunTime.StackTrace, RunTime.StackTraceId>> 
2062        restartFrame(String callFrameId)
2063    {
2064        // Exception-Check(s) to ensure that if any parameters which are not declared as
2065        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2066        
2067        if (callFrameId == null) BRDPC.throwNPE("callFrameId");
2068        
2069        final int       webSocketID = 2011000 + counter++;
2070        final boolean[] optionals   = { false, };
2071        
2072        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2073        String requestJSON = WriteJSON.get(
2074            parameterTypes.get("restartFrame"),
2075            parameterNames.get("restartFrame"),
2076            optionals, webSocketID,
2077            "Debugger.restartFrame",
2078            callFrameId
2079        );
2080        
2081        // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret3'
2082        Function<JsonObject, Ret3<Debugger.CallFrame[], RunTime.StackTrace, RunTime.StackTraceId>> 
2083            responseProcessor = (JsonObject jo) -> new Ret3<>(
2084                (jo.getJsonArray("callFrames") == null)
2085                    ? null
2086                    : ReadArrJSON.DimN.objArr(jo.getJsonArray("callFrames"), null, 0, Debugger.CallFrame[].class),
2087                ReadJSON.XL.getObject(jo, "asyncStackTrace", RunTime.StackTrace.class, true, false),
2088                ReadJSON.XL.getObject(jo, "asyncStackTraceId", RunTime.StackTraceId.class, true, false)
2089            );
2090        
2091        // Pass the 'defaultSender' to Script-Constructor
2092        // The sender that is used can be changed before executing script.
2093        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
2094    }
2095    
2096    /**
2097     * Resumes JavaScript execution.
2098     * 
2099     * @param terminateOnResume 
2100     * Set to true to terminate execution upon resuming execution. In contrast
2101     * to RunTime.terminateExecution, this will allows to execute further
2102     * JavaScript (i.e. via evaluation) until execution of the paused code
2103     * is actually resumed, at which point termination is triggered.
2104     * If execution is currently not paused, this parameter has no effect.
2105     * <BR /><B>OPTIONAL</B>
2106     * 
2107     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2108     * {@link Ret0}&gt;</CODE>
2109     *
2110     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2111     * browser receives the invocation-request.
2112     *
2113     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2114     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2115     * {@code >} to ensure the Browser Function has run to completion.
2116     */
2117    public static Script<String, JsonObject, Ret0> resume(Boolean terminateOnResume)
2118    {
2119        final int       webSocketID = 2012000 + counter++;
2120        final boolean[] optionals   = { true, };
2121        
2122        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2123        String requestJSON = WriteJSON.get(
2124            parameterTypes.get("resume"),
2125            parameterNames.get("resume"),
2126            optionals, webSocketID,
2127            "Debugger.resume",
2128            terminateOnResume
2129        );
2130        
2131        // This Remote Command does not have a Return-Value.
2132        return new Script<>
2133            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2134    }
2135    
2136    /**
2137     * Searches for given string in script content.
2138     * 
2139     * @param scriptId Id of the script to search in.
2140     * 
2141     * @param query String to search for.
2142     * 
2143     * @param caseSensitive If true, search is case sensitive.
2144     * <BR /><B>OPTIONAL</B>
2145     * 
2146     * @param isRegex If true, treats string parameter as regex.
2147     * <BR /><B>OPTIONAL</B>
2148     * 
2149     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2150     * {@link Debugger.SearchMatch}[]&gt;</CODE>
2151     * 
2152     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
2153     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
2154     * {@link Debugger.SearchMatch}[]&gt;</CODE> will be returned.
2155     *
2156     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
2157     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
2158      * may be retrieved.</I>
2159     *
2160     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
2161     * <BR /><BR /><UL CLASS=JDUL>
2162     * <LI><CODE>{@link Debugger.SearchMatch}[] (<B>result</B></CODE>)
2163     *     <BR />List of search matches.
2164     * </LI>
2165     * </UL> */
2166    public static Script<String, JsonObject, Debugger.SearchMatch[]> searchInContent
2167        (String scriptId, String query, Boolean caseSensitive, Boolean isRegex)
2168    {
2169        // Exception-Check(s) to ensure that if any parameters which are not declared as
2170        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2171        
2172        if (scriptId == null) BRDPC.throwNPE("scriptId");
2173        if (query == null)    BRDPC.throwNPE("query");
2174        
2175        final int       webSocketID = 2013000 + counter++;
2176        final boolean[] optionals   = { false, false, true, true, };
2177        
2178        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2179        String requestJSON = WriteJSON.get(
2180            parameterTypes.get("searchInContent"),
2181            parameterNames.get("searchInContent"),
2182            optionals, webSocketID,
2183            "Debugger.searchInContent",
2184            scriptId, query, caseSensitive, isRegex
2185        );
2186        
2187        // 'JSON Binding' ... Converts Browser Response-JSON to 'Debugger.SearchMatch[]'
2188        Function<JsonObject, Debugger.SearchMatch[]> responseProcessor = (JsonObject jo) ->
2189            (jo.getJsonArray("result") == null)
2190                ? null
2191                : ReadArrJSON.DimN.objArr(jo.getJsonArray("result"), null, 0, Debugger.SearchMatch[].class);
2192        
2193        // Pass the 'defaultSender' to Script-Constructor
2194        // The sender that is used can be changed before executing script.
2195        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
2196    }
2197    
2198    /**
2199     * Enables or disables async call stacks tracking.
2200     * 
2201     * @param maxDepth 
2202     * Maximum depth of async call stacks. Setting to <CODE>0</CODE> will effectively disable collecting async
2203     * call stacks (default).
2204     * 
2205     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2206     * {@link Ret0}&gt;</CODE>
2207     *
2208     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2209     * browser receives the invocation-request.
2210     *
2211     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2212     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2213     * {@code >} to ensure the Browser Function has run to completion.
2214     */
2215    public static Script<String, JsonObject, Ret0> setAsyncCallStackDepth(int maxDepth)
2216    {
2217        final int       webSocketID = 2014000 + counter++;
2218        final boolean[] optionals   = { false, };
2219        
2220        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2221        String requestJSON = WriteJSON.get(
2222            parameterTypes.get("setAsyncCallStackDepth"),
2223            parameterNames.get("setAsyncCallStackDepth"),
2224            optionals, webSocketID,
2225            "Debugger.setAsyncCallStackDepth",
2226            maxDepth
2227        );
2228        
2229        // This Remote Command does not have a Return-Value.
2230        return new Script<>
2231            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2232    }
2233    
2234    /**
2235     * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
2236     * scripts with url matching one of the patterns. VM will try to leave blackboxed script by
2237     * performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
2238     * <BR /><B>EXPERIMENTAL</B>
2239     * 
2240     * @param patterns Array of regexps that will be used to check script url for blackbox state.
2241     * 
2242     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2243     * {@link Ret0}&gt;</CODE>
2244     *
2245     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2246     * browser receives the invocation-request.
2247     *
2248     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2249     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2250     * {@code >} to ensure the Browser Function has run to completion.
2251     */
2252    public static Script<String, JsonObject, Ret0> setBlackboxPatterns(String[] patterns)
2253    {
2254        // Exception-Check(s) to ensure that if any parameters which are not declared as
2255        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2256        
2257        if (patterns == null) BRDPC.throwNPE("patterns");
2258        
2259        final int       webSocketID = 2015000 + counter++;
2260        final boolean[] optionals   = { false, };
2261        
2262        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2263        String requestJSON = WriteJSON.get(
2264            parameterTypes.get("setBlackboxPatterns"),
2265            parameterNames.get("setBlackboxPatterns"),
2266            optionals, webSocketID,
2267            "Debugger.setBlackboxPatterns",
2268            (Object) patterns
2269        );
2270        
2271        // This Remote Command does not have a Return-Value.
2272        return new Script<>
2273            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2274    }
2275    
2276    /**
2277     * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
2278     * scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
2279     * Positions array contains positions where blackbox state is changed. First interval isn't
2280     * blackboxed. Array should be sorted.
2281     * <BR /><B>EXPERIMENTAL</B>
2282     * 
2283     * @param scriptId Id of the script.
2284     * 
2285     * @param positions -
2286     * 
2287     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2288     * {@link Ret0}&gt;</CODE>
2289     *
2290     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2291     * browser receives the invocation-request.
2292     *
2293     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2294     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2295     * {@code >} to ensure the Browser Function has run to completion.
2296     */
2297    public static Script<String, JsonObject, Ret0> setBlackboxedRanges
2298        (String scriptId, Debugger.ScriptPosition[] positions)
2299    {
2300        // Exception-Check(s) to ensure that if any parameters which are not declared as
2301        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2302        
2303        if (scriptId == null)  BRDPC.throwNPE("scriptId");
2304        if (positions == null) BRDPC.throwNPE("positions");
2305        
2306        final int       webSocketID = 2016000 + counter++;
2307        final boolean[] optionals   = { false, false, };
2308        
2309        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2310        String requestJSON = WriteJSON.get(
2311            parameterTypes.get("setBlackboxedRanges"),
2312            parameterNames.get("setBlackboxedRanges"),
2313            optionals, webSocketID,
2314            "Debugger.setBlackboxedRanges",
2315            scriptId, positions
2316        );
2317        
2318        // This Remote Command does not have a Return-Value.
2319        return new Script<>
2320            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2321    }
2322    
2323    /**
2324     * Sets JavaScript breakpoint at a given location.
2325     * 
2326     * @param location Location to set breakpoint in.
2327     * 
2328     * @param condition 
2329     * Expression to use as a breakpoint condition. When specified, debugger will only stop on the
2330     * breakpoint if this expression evaluates to true.
2331     * <BR /><B>OPTIONAL</B>
2332     * 
2333     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2334     * {@link Ret2}&gt;</CODE>
2335     *
2336     * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 
2337     * {@link Script#exec()}), and a {@link Promise} returned.
2338     *
2339     * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B>
2340     * (using {@link Promise#await()}), the {@code Ret2} will subsequently
2341     * be returned from that call.
2342     * 
2343     * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated
2344     * in an instance of <B>{@link Ret2}</B>
2345     *
2346     * <BR /><BR /><UL CLASS=JDUL>
2347     * <LI><CODE><B>Ret2.a:</B> String (<B>breakpointId</B>)</CODE>
2348     *     <BR />Id of the created breakpoint for further reference.
2349     *     <BR /><BR /></LI>
2350     * <LI><CODE><B>Ret2.b:</B> {@link Debugger.Location} (<B>actualLocation</B>)</CODE>
2351     *     <BR />Location this breakpoint resolved into.
2352     *     </LI>
2353     * </UL>
2354     */
2355    public static Script<String, JsonObject, Ret2<String, Debugger.Location>> setBreakpoint
2356        (Debugger.Location location, String condition)
2357    {
2358        // Exception-Check(s) to ensure that if any parameters which are not declared as
2359        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2360        
2361        if (location == null) BRDPC.throwNPE("location");
2362        
2363        final int       webSocketID = 2017000 + counter++;
2364        final boolean[] optionals   = { false, true, };
2365        
2366        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2367        String requestJSON = WriteJSON.get(
2368            parameterTypes.get("setBreakpoint"),
2369            parameterNames.get("setBreakpoint"),
2370            optionals, webSocketID,
2371            "Debugger.setBreakpoint",
2372            location, condition
2373        );
2374        
2375        // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2'
2376        Function<JsonObject, Ret2<String, Debugger.Location>> 
2377            responseProcessor = (JsonObject jo) -> new Ret2<>(
2378                ReadJSON.getString(jo, "breakpointId", false, true),
2379                ReadJSON.XL.getObject(jo, "actualLocation", Debugger.Location.class, false, true)
2380            );
2381        
2382        // Pass the 'defaultSender' to Script-Constructor
2383        // The sender that is used can be changed before executing script.
2384        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
2385    }
2386    
2387    /**
2388     * Sets instrumentation breakpoint.
2389     * 
2390     * @param instrumentation Instrumentation name.
2391     * <BR />Acceptable Values: ["beforeScriptExecution", "beforeScriptWithSourceMapExecution"]
2392     * 
2393     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2394     * String&gt;</CODE>
2395     * 
2396     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
2397     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
2398     * String&gt;</CODE> will be returned.
2399     *
2400     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
2401     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
2402      * may be retrieved.</I>
2403     *
2404     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
2405     * <BR /><BR /><UL CLASS=JDUL>
2406     * <LI><CODE>String (<B>breakpointId</B></CODE>)
2407     *     <BR />Id of the created breakpoint for further reference.
2408     * </LI>
2409     * </UL> */
2410    public static Script<String, JsonObject, String> setInstrumentationBreakpoint
2411        (String instrumentation)
2412    {
2413        // Exception-Check(s) to ensure that if any parameters which are not declared as
2414        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2415        
2416        if (instrumentation == null) BRDPC.throwNPE("instrumentation");
2417        
2418        // Exception-Check(s) to ensure that if any parameters which must adhere to a
2419        // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
2420        
2421        BRDPC.checkIAE(
2422            "instrumentation", instrumentation,
2423            "beforeScriptExecution", "beforeScriptWithSourceMapExecution"
2424        );
2425        
2426        final int       webSocketID = 2018000 + counter++;
2427        final boolean[] optionals   = { false, };
2428        
2429        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2430        String requestJSON = WriteJSON.get(
2431            parameterTypes.get("setInstrumentationBreakpoint"),
2432            parameterNames.get("setInstrumentationBreakpoint"),
2433            optionals, webSocketID,
2434            "Debugger.setInstrumentationBreakpoint",
2435            instrumentation
2436        );
2437        
2438        // 'JSON Binding' ... Converts Browser Response-JSON to 'String'
2439        Function<JsonObject, String> responseProcessor = (JsonObject jo) ->
2440            ReadJSON.getString(jo, "breakpointId", false, true);
2441        
2442        // Pass the 'defaultSender' to Script-Constructor
2443        // The sender that is used can be changed before executing script.
2444        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
2445    }
2446    
2447    /**
2448     * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
2449     * command is issued, all existing parsed scripts will have breakpoints resolved and returned in
2450     * <CODE>locations</CODE> property. Further matching script parsing will result in subsequent
2451     * <CODE>breakpointResolved</CODE> events issued. This logical breakpoint will survive page reloads.
2452     * 
2453     * @param lineNumber Line number to set breakpoint at.
2454     * 
2455     * @param url URL of the resources to set breakpoint on.
2456     * <BR /><B>OPTIONAL</B>
2457     * 
2458     * @param urlRegex 
2459     * Regex pattern for the URLs of the resources to set breakpoints on. Either <CODE>url</CODE> or
2460     * <CODE>urlRegex</CODE> must be specified.
2461     * <BR /><B>OPTIONAL</B>
2462     * 
2463     * @param scriptHash Script hash of the resources to set breakpoint on.
2464     * <BR /><B>OPTIONAL</B>
2465     * 
2466     * @param columnNumber Offset in the line to set breakpoint at.
2467     * <BR /><B>OPTIONAL</B>
2468     * 
2469     * @param condition 
2470     * Expression to use as a breakpoint condition. When specified, debugger will only stop on the
2471     * breakpoint if this expression evaluates to true.
2472     * <BR /><B>OPTIONAL</B>
2473     * 
2474     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2475     * {@link Ret2}&gt;</CODE>
2476     *
2477     * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 
2478     * {@link Script#exec()}), and a {@link Promise} returned.
2479     *
2480     * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B>
2481     * (using {@link Promise#await()}), the {@code Ret2} will subsequently
2482     * be returned from that call.
2483     * 
2484     * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated
2485     * in an instance of <B>{@link Ret2}</B>
2486     *
2487     * <BR /><BR /><UL CLASS=JDUL>
2488     * <LI><CODE><B>Ret2.a:</B> String (<B>breakpointId</B>)</CODE>
2489     *     <BR />Id of the created breakpoint for further reference.
2490     *     <BR /><BR /></LI>
2491     * <LI><CODE><B>Ret2.b:</B> {@link Debugger.Location}[] (<B>locations</B>)</CODE>
2492     *     <BR />List of the locations this breakpoint resolved into upon addition.
2493     *     </LI>
2494     * </UL>
2495     */
2496    public static Script<String, JsonObject, Ret2<String, Debugger.Location[]>> setBreakpointByUrl(
2497            int lineNumber, String url, String urlRegex, String scriptHash, Integer columnNumber, 
2498            String condition
2499        )
2500    {
2501        final int       webSocketID = 2019000 + counter++;
2502        final boolean[] optionals   = { false, true, true, true, true, true, };
2503        
2504        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2505        String requestJSON = WriteJSON.get(
2506            parameterTypes.get("setBreakpointByUrl"),
2507            parameterNames.get("setBreakpointByUrl"),
2508            optionals, webSocketID,
2509            "Debugger.setBreakpointByUrl",
2510            lineNumber, url, urlRegex, scriptHash, columnNumber, condition
2511        );
2512        
2513        // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2'
2514        Function<JsonObject, Ret2<String, Debugger.Location[]>> 
2515            responseProcessor = (JsonObject jo) -> new Ret2<>(
2516                ReadJSON.getString(jo, "breakpointId", false, true),
2517                (jo.getJsonArray("locations") == null)
2518                    ? null
2519                    : ReadArrJSON.DimN.objArr(jo.getJsonArray("locations"), null, 0, Debugger.Location[].class)
2520            );
2521        
2522        // Pass the 'defaultSender' to Script-Constructor
2523        // The sender that is used can be changed before executing script.
2524        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
2525    }
2526    
2527    /**
2528     * Sets JavaScript breakpoint before each call to the given function.
2529     * If another function was created from the same source as a given one,
2530     * calling it will also trigger the breakpoint.
2531     * <BR /><B>EXPERIMENTAL</B>
2532     * 
2533     * @param objectId Function object id.
2534     * 
2535     * @param condition 
2536     * Expression to use as a breakpoint condition. When specified, debugger will
2537     * stop on the breakpoint if this expression evaluates to true.
2538     * <BR /><B>OPTIONAL</B>
2539     * 
2540     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2541     * String&gt;</CODE>
2542     * 
2543     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
2544     * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE>&lt;JsonObject,
2545     * String&gt;</CODE> will be returned.
2546     *
2547     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
2548     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
2549      * may be retrieved.</I>
2550     *
2551     * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B>
2552     * <BR /><BR /><UL CLASS=JDUL>
2553     * <LI><CODE>String (<B>breakpointId</B></CODE>)
2554     *     <BR />Id of the created breakpoint for further reference.
2555     * </LI>
2556     * </UL> */
2557    public static Script<String, JsonObject, String> setBreakpointOnFunctionCall
2558        (String objectId, String condition)
2559    {
2560        // Exception-Check(s) to ensure that if any parameters which are not declared as
2561        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2562        
2563        if (objectId == null) BRDPC.throwNPE("objectId");
2564        
2565        final int       webSocketID = 2020000 + counter++;
2566        final boolean[] optionals   = { false, true, };
2567        
2568        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2569        String requestJSON = WriteJSON.get(
2570            parameterTypes.get("setBreakpointOnFunctionCall"),
2571            parameterNames.get("setBreakpointOnFunctionCall"),
2572            optionals, webSocketID,
2573            "Debugger.setBreakpointOnFunctionCall",
2574            objectId, condition
2575        );
2576        
2577        // 'JSON Binding' ... Converts Browser Response-JSON to 'String'
2578        Function<JsonObject, String> responseProcessor = (JsonObject jo) ->
2579            ReadJSON.getString(jo, "breakpointId", false, true);
2580        
2581        // Pass the 'defaultSender' to Script-Constructor
2582        // The sender that is used can be changed before executing script.
2583        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
2584    }
2585    
2586    /**
2587     * Activates / deactivates all breakpoints on the page.
2588     * 
2589     * @param active New value for breakpoints active state.
2590     * 
2591     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2592     * {@link Ret0}&gt;</CODE>
2593     *
2594     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2595     * browser receives the invocation-request.
2596     *
2597     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2598     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2599     * {@code >} to ensure the Browser Function has run to completion.
2600     */
2601    public static Script<String, JsonObject, Ret0> setBreakpointsActive(boolean active)
2602    {
2603        final int       webSocketID = 2021000 + counter++;
2604        final boolean[] optionals   = { false, };
2605        
2606        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2607        String requestJSON = WriteJSON.get(
2608            parameterTypes.get("setBreakpointsActive"),
2609            parameterNames.get("setBreakpointsActive"),
2610            optionals, webSocketID,
2611            "Debugger.setBreakpointsActive",
2612            active
2613        );
2614        
2615        // This Remote Command does not have a Return-Value.
2616        return new Script<>
2617            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2618    }
2619    
2620    /**
2621     * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or
2622     * no exceptions. Initial pause on exceptions state is <CODE>none</CODE>.
2623     * 
2624     * @param state Pause on exceptions mode.
2625     * <BR />Acceptable Values: ["none", "uncaught", "all"]
2626     * 
2627     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2628     * {@link Ret0}&gt;</CODE>
2629     *
2630     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2631     * browser receives the invocation-request.
2632     *
2633     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2634     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2635     * {@code >} to ensure the Browser Function has run to completion.
2636     */
2637    public static Script<String, JsonObject, Ret0> setPauseOnExceptions(String state)
2638    {
2639        // Exception-Check(s) to ensure that if any parameters which are not declared as
2640        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2641        
2642        if (state == null) BRDPC.throwNPE("state");
2643        
2644        // Exception-Check(s) to ensure that if any parameters which must adhere to a
2645        // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw.
2646        
2647        BRDPC.checkIAE(
2648            "state", state,
2649            "none", "uncaught", "all"
2650        );
2651        
2652        final int       webSocketID = 2022000 + counter++;
2653        final boolean[] optionals   = { false, };
2654        
2655        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2656        String requestJSON = WriteJSON.get(
2657            parameterTypes.get("setPauseOnExceptions"),
2658            parameterNames.get("setPauseOnExceptions"),
2659            optionals, webSocketID,
2660            "Debugger.setPauseOnExceptions",
2661            state
2662        );
2663        
2664        // This Remote Command does not have a Return-Value.
2665        return new Script<>
2666            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2667    }
2668    
2669    /**
2670     * Changes return value in top frame. Available only at return break position.
2671     * <BR /><B>EXPERIMENTAL</B>
2672     * 
2673     * @param newValue New return value.
2674     * 
2675     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2676     * {@link Ret0}&gt;</CODE>
2677     *
2678     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2679     * browser receives the invocation-request.
2680     *
2681     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2682     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2683     * {@code >} to ensure the Browser Function has run to completion.
2684     */
2685    public static Script<String, JsonObject, Ret0> setReturnValue(RunTime.CallArgument newValue)
2686    {
2687        // Exception-Check(s) to ensure that if any parameters which are not declared as
2688        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2689        
2690        if (newValue == null) BRDPC.throwNPE("newValue");
2691        
2692        final int       webSocketID = 2023000 + counter++;
2693        final boolean[] optionals   = { false, };
2694        
2695        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2696        String requestJSON = WriteJSON.get(
2697            parameterTypes.get("setReturnValue"),
2698            parameterNames.get("setReturnValue"),
2699            optionals, webSocketID,
2700            "Debugger.setReturnValue",
2701            newValue
2702        );
2703        
2704        // This Remote Command does not have a Return-Value.
2705        return new Script<>
2706            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2707    }
2708    
2709    /**
2710     * Edits JavaScript source live.
2711     * 
2712     * @param scriptId Id of the script to edit.
2713     * 
2714     * @param scriptSource New content of the script.
2715     * 
2716     * @param dryRun 
2717     * If true the change will not actually be applied. Dry run may be used to get result
2718     * description without actually modifying the code.
2719     * <BR /><B>OPTIONAL</B>
2720     * 
2721     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2722     * {@link Ret5}&gt;</CODE>
2723     *
2724     * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 
2725     * {@link Script#exec()}), and a {@link Promise} returned.
2726     *
2727     * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B>
2728     * (using {@link Promise#await()}), the {@code Ret5} will subsequently
2729     * be returned from that call.
2730     * 
2731     * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated
2732     * in an instance of <B>{@link Ret5}</B>
2733     *
2734     * <BR /><BR /><UL CLASS=JDUL>
2735     * <LI><CODE><B>Ret5.a:</B> {@link Debugger.CallFrame}[] (<B>callFrames</B>)</CODE>
2736     *     <BR />New stack trace in case editing has happened while VM was stopped.
2737     *     <BR /><BR /></LI>
2738     * <LI><CODE><B>Ret5.b:</B> Boolean (<B>stackChanged</B>)</CODE>
2739     *     <BR />Whether current call stack  was modified after applying the changes.
2740     *     <BR /><BR /></LI>
2741     * <LI><CODE><B>Ret5.c:</B> {@link RunTime.StackTrace} (<B>asyncStackTrace</B>)</CODE>
2742     *     <BR />Async stack trace, if any.
2743     *     <BR /><BR /></LI>
2744     * <LI><CODE><B>Ret5.d:</B> {@link RunTime.StackTraceId} (<B>asyncStackTraceId</B>)</CODE>
2745     *     <BR />Async stack trace, if any.
2746     *     <BR /><BR /></LI>
2747     * <LI><CODE><B>Ret5.e:</B> {@link RunTime.ExceptionDetails} (<B>exceptionDetails</B>)</CODE>
2748     *     <BR />Exception details if any.
2749     *     </LI>
2750     * </UL>
2751     */
2752    public static Script<String, JsonObject, Ret5<Debugger.CallFrame[], Boolean, RunTime.StackTrace, RunTime.StackTraceId, RunTime.ExceptionDetails>> 
2753        setScriptSource(String scriptId, String scriptSource, Boolean dryRun)
2754    {
2755        // Exception-Check(s) to ensure that if any parameters which are not declared as
2756        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2757        
2758        if (scriptId == null)     BRDPC.throwNPE("scriptId");
2759        if (scriptSource == null) BRDPC.throwNPE("scriptSource");
2760        
2761        final int       webSocketID = 2024000 + counter++;
2762        final boolean[] optionals   = { false, false, true, };
2763        
2764        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2765        String requestJSON = WriteJSON.get(
2766            parameterTypes.get("setScriptSource"),
2767            parameterNames.get("setScriptSource"),
2768            optionals, webSocketID,
2769            "Debugger.setScriptSource",
2770            scriptId, scriptSource, dryRun
2771        );
2772        
2773        // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret5'
2774        Function<JsonObject, Ret5<Debugger.CallFrame[], Boolean, RunTime.StackTrace, RunTime.StackTraceId, RunTime.ExceptionDetails>> 
2775            responseProcessor = (JsonObject jo) -> new Ret5<>(
2776                (jo.getJsonArray("callFrames") == null)
2777                    ? null
2778                    : ReadArrJSON.DimN.objArr(jo.getJsonArray("callFrames"), null, 0, Debugger.CallFrame[].class),
2779                ReadJSON.getBOOLEAN(jo, "stackChanged", true),
2780                ReadJSON.XL.getObject(jo, "asyncStackTrace", RunTime.StackTrace.class, true, false),
2781                ReadJSON.XL.getObject(jo, "asyncStackTraceId", RunTime.StackTraceId.class, true, false),
2782                ReadJSON.XL.getObject(jo, "exceptionDetails", RunTime.ExceptionDetails.class, true, false)
2783            );
2784        
2785        // Pass the 'defaultSender' to Script-Constructor
2786        // The sender that is used can be changed before executing script.
2787        return new Script<>(BRDPC.defaultSender, webSocketID, requestJSON, responseProcessor);
2788    }
2789    
2790    /**
2791     * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
2792     * 
2793     * @param skip New value for skip pauses state.
2794     * 
2795     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2796     * {@link Ret0}&gt;</CODE>
2797     *
2798     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2799     * browser receives the invocation-request.
2800     *
2801     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2802     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2803     * {@code >} to ensure the Browser Function has run to completion.
2804     */
2805    public static Script<String, JsonObject, Ret0> setSkipAllPauses(boolean skip)
2806    {
2807        final int       webSocketID = 2025000 + counter++;
2808        final boolean[] optionals   = { false, };
2809        
2810        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2811        String requestJSON = WriteJSON.get(
2812            parameterTypes.get("setSkipAllPauses"),
2813            parameterNames.get("setSkipAllPauses"),
2814            optionals, webSocketID,
2815            "Debugger.setSkipAllPauses",
2816            skip
2817        );
2818        
2819        // This Remote Command does not have a Return-Value.
2820        return new Script<>
2821            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2822    }
2823    
2824    /**
2825     * Changes value of variable in a callframe. Object-based scopes are not supported and must be
2826     * mutated manually.
2827     * 
2828     * @param scopeNumber 
2829     * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'
2830     * scope types are allowed. Other scopes could be manipulated manually.
2831     * 
2832     * @param variableName Variable name.
2833     * 
2834     * @param newValue New variable value.
2835     * 
2836     * @param callFrameId Id of callframe that holds variable.
2837     * 
2838     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2839     * {@link Ret0}&gt;</CODE>
2840     *
2841     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2842     * browser receives the invocation-request.
2843     *
2844     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2845     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2846     * {@code >} to ensure the Browser Function has run to completion.
2847     */
2848    public static Script<String, JsonObject, Ret0> setVariableValue
2849        (int scopeNumber, String variableName, RunTime.CallArgument newValue, String callFrameId)
2850    {
2851        // Exception-Check(s) to ensure that if any parameters which are not declared as
2852        // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw.
2853        
2854        if (variableName == null) BRDPC.throwNPE("variableName");
2855        if (newValue == null)     BRDPC.throwNPE("newValue");
2856        if (callFrameId == null)  BRDPC.throwNPE("callFrameId");
2857        
2858        final int       webSocketID = 2026000 + counter++;
2859        final boolean[] optionals   = { false, false, false, false, };
2860        
2861        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2862        String requestJSON = WriteJSON.get(
2863            parameterTypes.get("setVariableValue"),
2864            parameterNames.get("setVariableValue"),
2865            optionals, webSocketID,
2866            "Debugger.setVariableValue",
2867            scopeNumber, variableName, newValue, callFrameId
2868        );
2869        
2870        // This Remote Command does not have a Return-Value.
2871        return new Script<>
2872            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2873    }
2874    
2875    /**
2876     * Steps into the function call.
2877     * 
2878     * @param breakOnAsyncCall 
2879     * Debugger will pause on the execution of the first async task which was scheduled
2880     * before next pause.
2881     * <BR /><B>OPTIONAL</B>
2882     * <BR /><B>EXPERIMENTAL</B>
2883     * 
2884     * @param skipList The skipList specifies location ranges that should be skipped on step into.
2885     * <BR /><B>OPTIONAL</B>
2886     * <BR /><B>EXPERIMENTAL</B>
2887     * 
2888     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2889     * {@link Ret0}&gt;</CODE>
2890     *
2891     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2892     * browser receives the invocation-request.
2893     *
2894     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2895     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2896     * {@code >} to ensure the Browser Function has run to completion.
2897     */
2898    public static Script<String, JsonObject, Ret0> stepInto
2899        (Boolean breakOnAsyncCall, Debugger.LocationRange[] skipList)
2900    {
2901        final int       webSocketID = 2027000 + counter++;
2902        final boolean[] optionals   = { true, true, };
2903        
2904        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2905        String requestJSON = WriteJSON.get(
2906            parameterTypes.get("stepInto"),
2907            parameterNames.get("stepInto"),
2908            optionals, webSocketID,
2909            "Debugger.stepInto",
2910            breakOnAsyncCall, skipList
2911        );
2912        
2913        // This Remote Command does not have a Return-Value.
2914        return new Script<>
2915            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2916    }
2917    
2918    /**
2919     * Steps out of the function call.
2920     * 
2921     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2922     * {@link Ret0}&gt;</CODE>
2923     *
2924     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2925     * browser receives the invocation-request.
2926     *
2927     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2928     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2929     * {@code >} to ensure the Browser Function has run to completion.
2930     */
2931    public static Script<String, JsonObject, Ret0> stepOut()
2932    {
2933        final int          webSocketID = 2028000 + counter++;
2934        final boolean[]    optionals   = new boolean[0];
2935        
2936        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2937        String requestJSON = WriteJSON.get(
2938            parameterTypes.get("stepOut"),
2939            parameterNames.get("stepOut"),
2940            optionals, webSocketID,
2941            "Debugger.stepOut"
2942        );
2943        
2944        // This Remote Command does not have a Return-Value.
2945        return new Script<>
2946            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2947    }
2948    
2949    /**
2950     * Steps over the statement.
2951     * 
2952     * @param skipList The skipList specifies location ranges that should be skipped on step over.
2953     * <BR /><B>OPTIONAL</B>
2954     * <BR /><B>EXPERIMENTAL</B>
2955     * 
2956     * @return An instance of <CODE>{@link Script}&lt;String, {@link JsonObject},
2957     * {@link Ret0}&gt;</CODE>
2958     *
2959     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
2960     * browser receives the invocation-request.
2961     *
2962     * <BR /><BR />This Browser-Function <I>does not have</I> a return-value.  You may choose to
2963     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0}
2964     * {@code >} to ensure the Browser Function has run to completion.
2965     */
2966    public static Script<String, JsonObject, Ret0> stepOver(Debugger.LocationRange[] skipList)
2967    {
2968        final int       webSocketID = 2029000 + counter++;
2969        final boolean[] optionals   = { true, };
2970        
2971        // Convert Method Parameters into JSON.  Build the JSON Request-Object (as a String)
2972        String requestJSON = WriteJSON.get(
2973            parameterTypes.get("stepOver"),
2974            parameterNames.get("stepOver"),
2975            optionals, webSocketID,
2976            "Debugger.stepOver",
2977            (Object) skipList
2978        );
2979        
2980        // This Remote Command does not have a Return-Value.
2981        return new Script<>
2982            (BRDPC.defaultSender, webSocketID, requestJSON, BRDPC.NoReturnValues);
2983    }
2984    
2985}