Home | History | Annotate | Download | only in inspector
      1 // Copyright 2016 the V8 project authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 /** @typedef {{
      6         type: string,
      7         object: !Object,
      8         name: (string|undefined),
      9         startLocation: (!RawLocation|undefined),
     10         endLocation: (!RawLocation|undefined)
     11     }} */
     12 var Scope;
     13 
     14 /** @typedef {{
     15         scriptId: string,
     16         lineNumber: number,
     17         columnNumber: number
     18     }} */
     19 var RawLocation;
     20 
     21 /** @typedef {{
     22         functionName: string,
     23         location: !RawLocation,
     24         this: !Object,
     25         scopeChain: !Array<!Scope>,
     26         functionLocation: (RawLocation|undefined),
     27         returnValue: (*|undefined)
     28     }} */
     29 var JavaScriptCallFrameDetails;
     30 
     31 /** @typedef {{
     32         contextId: function():number,
     33         thisObject: !Object,
     34         evaluate: function(string, boolean):*,
     35         restart: function():undefined,
     36         setVariableValue: function(number, string, *):undefined,
     37         isAtReturn: boolean,
     38         details: function():!JavaScriptCallFrameDetails
     39     }} */
     40 var JavaScriptCallFrame;
     41 
     42 /**
     43  * @const
     44  */
     45 var Debug = {};
     46 
     47 Debug.clearAllBreakPoints = function() {}
     48 
     49 /** @return {!Array<!Script>} */
     50 Debug.scripts = function() {}
     51 
     52 /**
     53  * @param {number} scriptId
     54  * @param {number=} line
     55  * @param {number=} column
     56  * @param {string=} condition
     57  * @param {string=} groupId
     58  * @param {Debug.BreakPositionAlignment=} positionAlignment
     59  */
     60 Debug.setScriptBreakPointById = function(scriptId, line, column, condition, groupId, positionAlignment) {}
     61 
     62 /**
     63  * @param {number} breakId
     64  * @return {!Array<!SourceLocation>}
     65  */
     66 Debug.findBreakPointActualLocations = function(breakId) {}
     67 
     68 /**
     69  * @param {number} breakId
     70  * @param {boolean} remove
     71  * @return {!BreakPoint|undefined}
     72  */
     73 Debug.findBreakPoint = function(breakId, remove) {}
     74 
     75 /** @enum */
     76 const BreakPositionAlignment = {
     77     Statement: 0,
     78     BreakPosition: 1
     79 };
     80 Debug.BreakPositionAlignment = BreakPositionAlignment;
     81 
     82 /** @const */
     83 var LiveEdit = {}
     84 
     85 /**
     86  * @param {!Script} script
     87  * @param {string} newSource
     88  * @param {boolean} previewOnly
     89  * @return {!{stack_modified: (boolean|undefined)}}
     90  */
     91 LiveEdit.SetScriptSource = function(script, newSource, previewOnly, change_log) {}
     92 
     93 /** @constructor */
     94 function Failure() {}
     95 LiveEdit.Failure = Failure;
     96 
     97 Debug.LiveEdit = LiveEdit;
     98 
     99 /** @typedef {{
    100  *    type: string,
    101  *    syntaxErrorMessage: string,
    102  *    position: !{start: !{line: number, column: number}},
    103  *  }}
    104  */
    105 var LiveEditErrorDetails;
    106 
    107 /** @typedef {{
    108  *    breakpointId: number,
    109  *    sourceID: number,
    110  *    lineNumber: (number|undefined),
    111  *    columnNumber: (number|undefined),
    112  *    condition: (string|undefined),
    113  *    interstatementLocation: (boolean|undefined),
    114  *    }}
    115  */
    116 var BreakpointInfo;
    117 
    118 
    119 /** @interface */
    120 function BreakPoint() {}
    121 
    122 /** @return {!BreakPoint|undefined} */
    123 BreakPoint.prototype.script_break_point = function() {}
    124 
    125 /** @return {number} */
    126 BreakPoint.prototype.number = function() {}
    127 
    128 
    129 /** @interface */
    130 function ExecutionState() {}
    131 
    132 /**
    133  * @param {string} source
    134  */
    135 ExecutionState.prototype.evaluateGlobal = function(source) {}
    136 
    137 /** @return {number} */
    138 ExecutionState.prototype.frameCount = function() {}
    139 
    140 /**
    141  * @param {number} index
    142  * @return {!FrameMirror}
    143  */
    144 ExecutionState.prototype.frame = function(index) {}
    145 
    146 /** @param {number} index */
    147 ExecutionState.prototype.setSelectedFrame = function(index) {}
    148 
    149 /** @return {number} */
    150 ExecutionState.prototype.selectedFrame = function() {}
    151 
    152 
    153 /** @enum */
    154 var ScopeType = { Global: 0,
    155                   Local: 1,
    156                   With: 2,
    157                   Closure: 3,
    158                   Catch: 4,
    159                   Block: 5,
    160                   Script: 6,
    161                   Eval: 7,
    162                   Module: 8};
    163 
    164 
    165 /** @typedef {{
    166  *    script: number,
    167  *    position: number,
    168  *    line: number,
    169  *    column:number,
    170  *    start: number,
    171  *    end: number,
    172  *    }}
    173  */
    174 var SourceLocation;
    175 
    176 /** @typedef{{
    177  *    id: number,
    178  *    context_data: (string|undefined),
    179  *    }}
    180  */
    181 var Script;
    182 
    183 /** @interface */
    184 function ScopeDetails() {}
    185 
    186 /** @return {!Object} */
    187 ScopeDetails.prototype.object = function() {}
    188 
    189 /** @return {string|undefined} */
    190 ScopeDetails.prototype.name = function() {}
    191 
    192 /** @return {number} */
    193 ScopeDetails.prototype.type = function() {}
    194 
    195 
    196 /** @interface */
    197 function FrameDetails() {}
    198 
    199 /** @return {!Object} */
    200 FrameDetails.prototype.receiver = function() {}
    201 
    202 /** @return {function()} */
    203 FrameDetails.prototype.func = function() {}
    204 
    205 /** @return {!Object} */
    206 FrameDetails.prototype.script = function() {}
    207 
    208 /** @return {boolean} */
    209 FrameDetails.prototype.isAtReturn = function() {}
    210 
    211 /** @return {number} */
    212 FrameDetails.prototype.sourcePosition = function() {}
    213 
    214 /** @return {*} */
    215 FrameDetails.prototype.returnValue = function() {}
    216 
    217 /** @return {number} */
    218 FrameDetails.prototype.scopeCount = function() {}
    219 
    220 /**
    221  * @param {*} value
    222  * @return {!Mirror}
    223  */
    224 function MakeMirror(value) {}
    225 
    226 
    227 /** @interface */
    228 function Mirror() {}
    229 
    230 /** @return {boolean} */
    231 Mirror.prototype.isFunction = function() {}
    232 
    233 /** @return {boolean} */
    234 Mirror.prototype.isGenerator = function() {}
    235 
    236 /**
    237  * @interface
    238  * @extends {Mirror}
    239  */
    240 function ObjectMirror() {}
    241 
    242 /** @return {!Array<!PropertyMirror>} */
    243 ObjectMirror.prototype.properties = function() {}
    244 
    245 
    246 /**
    247  * @interface
    248  * @extends {ObjectMirror}
    249  */
    250 function FunctionMirror () {}
    251 
    252 /** @return {number} */
    253 FunctionMirror.prototype.scopeCount = function() {}
    254 
    255 /**
    256  * @param {number} index
    257  * @return {!ScopeMirror|undefined}
    258  */
    259 FunctionMirror.prototype.scope = function(index) {}
    260 
    261 /** @return {boolean} */
    262 FunctionMirror.prototype.resolved = function() {}
    263 
    264 /** @return {function()} */
    265 FunctionMirror.prototype.value = function() {}
    266 
    267 /** @return {string} */
    268 FunctionMirror.prototype.debugName = function() {}
    269 
    270 /** @return {!ScriptMirror|undefined} */
    271 FunctionMirror.prototype.script = function() {}
    272 
    273 /** @return {!SourceLocation|undefined} */
    274 FunctionMirror.prototype.sourceLocation = function() {}
    275 
    276 /** @return {!ContextMirror|undefined} */
    277 FunctionMirror.prototype.context = function() {}
    278 
    279 /**
    280  * @constructor
    281  * @param {*} value
    282  */
    283 function UnresolvedFunctionMirror(value) {}
    284 
    285 /**
    286  * @interface
    287  * @extends {ObjectMirror}
    288  */
    289 function GeneratorMirror () {}
    290 
    291 /** @return {number} */
    292 GeneratorMirror.prototype.scopeCount = function() {}
    293 
    294 /**
    295  * @param {number} index
    296  * @return {!ScopeMirror|undefined}
    297  */
    298 GeneratorMirror.prototype.scope = function(index) {}
    299 
    300 
    301 /**
    302  * @interface
    303  * @extends {Mirror}
    304  */
    305 function PropertyMirror() {}
    306 
    307 /** @return {!Mirror} */
    308 PropertyMirror.prototype.value = function() {}
    309 
    310 /** @return {string} */
    311 PropertyMirror.prototype.name = function() {}
    312 
    313 /** @type {*} */
    314 PropertyMirror.prototype.value_;
    315 
    316 /**
    317  * @interface
    318  * @extends {Mirror}
    319  */
    320 function FrameMirror() {}
    321 
    322 /**
    323  * @param {boolean=} ignoreNestedScopes
    324  * @return {!Array<!ScopeMirror>}
    325  */
    326 FrameMirror.prototype.allScopes = function(ignoreNestedScopes) {}
    327 
    328 /** @return {!FrameDetails} */
    329 FrameMirror.prototype.details = function() {}
    330 
    331 /** @return {!ScriptMirror} */
    332 FrameMirror.prototype.script = function() {}
    333 
    334 /**
    335  * @param {string} source
    336  * @param {boolean} throwOnSideEffect
    337  */
    338 FrameMirror.prototype.evaluate = function(source, throwOnSideEffect) {}
    339 
    340 FrameMirror.prototype.restart = function() {}
    341 
    342 /** @param {number} index */
    343 FrameMirror.prototype.scope = function(index) {}
    344 
    345 
    346 /**
    347  * @interface
    348  * @extends {Mirror}
    349  */
    350 function ScriptMirror() {}
    351 
    352 /** @return {!Script} */
    353 ScriptMirror.prototype.value = function() {}
    354 
    355 /** @return {number} */
    356 ScriptMirror.prototype.id = function() {}
    357 
    358 /**
    359  * @param {number} position
    360  * @param {boolean=} includeResourceOffset
    361  */
    362 ScriptMirror.prototype.locationFromPosition = function(position, includeResourceOffset) {}
    363 
    364 
    365 /**
    366  * @interface
    367  * @extends {Mirror}
    368  */
    369 function ScopeMirror() {}
    370 
    371 /** @return {!ScopeDetails} */
    372 ScopeMirror.prototype.details = function() {}
    373 
    374 /**
    375  * @param {string} name
    376  * @param {*} newValue
    377  */
    378 ScopeMirror.prototype.setVariableValue = function(name, newValue) {}
    379 
    380 /**
    381  * @interface
    382  * @extends {Mirror}
    383  */
    384 function ContextMirror() {}
    385 
    386 /** @return {string|undefined} */
    387 ContextMirror.prototype.data = function() {}
    388