OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 } | 236 } |
237 if (callback) | 237 if (callback) |
238 callback(scriptId, exceptionDetails); | 238 callback(scriptId, exceptionDetails); |
239 } | 239 } |
240 }, | 240 }, |
241 | 241 |
242 /** | 242 /** |
243 * @param {!RuntimeAgent.ScriptId} scriptId | 243 * @param {!RuntimeAgent.ScriptId} scriptId |
244 * @param {number} executionContextId | 244 * @param {number} executionContextId |
245 * @param {string=} objectGroup | 245 * @param {string=} objectGroup |
246 * @param {boolean=} doNotPauseOnExceptionsAndMuteConsole | 246 * @param {boolean=} silent |
247 * @param {boolean=} includeCommandLineAPI | 247 * @param {boolean=} includeCommandLineAPI |
248 * @param {boolean=} returnByValue | 248 * @param {boolean=} returnByValue |
249 * @param {boolean=} generatePreview | 249 * @param {boolean=} generatePreview |
250 * @param {boolean=} awaitPromise | 250 * @param {boolean=} awaitPromise |
251 * @param {function(?RuntimeAgent.RemoteObject, ?RuntimeAgent.ExceptionDetai
ls=)=} callback | 251 * @param {function(?RuntimeAgent.RemoteObject, ?RuntimeAgent.ExceptionDetai
ls=)=} callback |
252 */ | 252 */ |
253 runScript: function(scriptId, executionContextId, objectGroup, doNotPauseOnE
xceptionsAndMuteConsole, includeCommandLineAPI, returnByValue, generatePreview,
awaitPromise, callback) | 253 runScript: function(scriptId, executionContextId, objectGroup, silent, inclu
deCommandLineAPI, returnByValue, generatePreview, awaitPromise, callback) |
254 { | 254 { |
255 this._agent.runScript(scriptId, executionContextId, objectGroup, doNotPa
useOnExceptionsAndMuteConsole, includeCommandLineAPI, returnByValue, generatePre
view, awaitPromise, innerCallback); | 255 this._agent.runScript(scriptId, executionContextId, objectGroup, silent,
includeCommandLineAPI, returnByValue, generatePreview, awaitPromise, innerCallb
ack); |
256 | 256 |
257 /** | 257 /** |
258 * @param {?Protocol.Error} error | 258 * @param {?Protocol.Error} error |
259 * @param {!RuntimeAgent.RemoteObject} result | 259 * @param {!RuntimeAgent.RemoteObject} result |
260 * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails | 260 * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails |
261 */ | 261 */ |
262 function innerCallback(error, result, exceptionDetails) | 262 function innerCallback(error, result, exceptionDetails) |
263 { | 263 { |
264 if (error) { | 264 if (error) { |
265 console.error(error); | 265 console.error(error); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 if (b.isDefault) | 540 if (b.isDefault) |
541 return +1; | 541 return +1; |
542 return a.name.localeCompare(b.name); | 542 return a.name.localeCompare(b.name); |
543 } | 543 } |
544 | 544 |
545 WebInspector.ExecutionContext.prototype = { | 545 WebInspector.ExecutionContext.prototype = { |
546 /** | 546 /** |
547 * @param {string} expression | 547 * @param {string} expression |
548 * @param {string} objectGroup | 548 * @param {string} objectGroup |
549 * @param {boolean} includeCommandLineAPI | 549 * @param {boolean} includeCommandLineAPI |
550 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole | 550 * @param {boolean} silent |
551 * @param {boolean} returnByValue | 551 * @param {boolean} returnByValue |
552 * @param {boolean} generatePreview | 552 * @param {boolean} generatePreview |
553 * @param {boolean} userGesture | 553 * @param {boolean} userGesture |
554 * @param {function(?WebInspector.RemoteObject, !RuntimeAgent.ExceptionDetai
ls=)} callback | 554 * @param {function(?WebInspector.RemoteObject, !RuntimeAgent.ExceptionDetai
ls=)} callback |
555 */ | 555 */ |
556 evaluate: function(expression, objectGroup, includeCommandLineAPI, doNotPaus
eOnExceptionsAndMuteConsole, returnByValue, generatePreview, userGesture, callba
ck) | 556 evaluate: function(expression, objectGroup, includeCommandLineAPI, silent, r
eturnByValue, generatePreview, userGesture, callback) |
557 { | 557 { |
558 // FIXME: It will be moved to separate ExecutionContext. | 558 // FIXME: It will be moved to separate ExecutionContext. |
559 if (this.debuggerModel.selectedCallFrame()) { | 559 if (this.debuggerModel.selectedCallFrame()) { |
560 this.debuggerModel.evaluateOnSelectedCallFrame(expression, objectGro
up, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue,
generatePreview, callback); | 560 this.debuggerModel.evaluateOnSelectedCallFrame(expression, objectGro
up, includeCommandLineAPI, silent, returnByValue, generatePreview, callback); |
561 return; | 561 return; |
562 } | 562 } |
563 this._evaluateGlobal.apply(this, arguments); | 563 this._evaluateGlobal.apply(this, arguments); |
564 }, | 564 }, |
565 | 565 |
566 /** | 566 /** |
567 * @param {string} objectGroup | 567 * @param {string} objectGroup |
568 * @param {boolean} generatePreview | 568 * @param {boolean} generatePreview |
569 * @param {function(?WebInspector.RemoteObject, !RuntimeAgent.ExceptionDetai
ls=)} callback | 569 * @param {function(?WebInspector.RemoteObject, !RuntimeAgent.ExceptionDetai
ls=)} callback |
570 */ | 570 */ |
571 globalObject: function(objectGroup, generatePreview, callback) | 571 globalObject: function(objectGroup, generatePreview, callback) |
572 { | 572 { |
573 this._evaluateGlobal("this", objectGroup, false, true, false, generatePr
eview, false, callback); | 573 this._evaluateGlobal("this", objectGroup, false, true, false, generatePr
eview, false, callback); |
574 }, | 574 }, |
575 | 575 |
576 /** | 576 /** |
577 * @param {string} expression | 577 * @param {string} expression |
578 * @param {string} objectGroup | 578 * @param {string} objectGroup |
579 * @param {boolean} includeCommandLineAPI | 579 * @param {boolean} includeCommandLineAPI |
580 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole | 580 * @param {boolean} silent |
581 * @param {boolean} returnByValue | 581 * @param {boolean} returnByValue |
582 * @param {boolean} generatePreview | 582 * @param {boolean} generatePreview |
583 * @param {boolean} userGesture | 583 * @param {boolean} userGesture |
584 * @param {function(?WebInspector.RemoteObject, !RuntimeAgent.ExceptionDetai
ls=)} callback | 584 * @param {function(?WebInspector.RemoteObject, !RuntimeAgent.ExceptionDetai
ls=)} callback |
585 */ | 585 */ |
586 _evaluateGlobal: function(expression, objectGroup, includeCommandLineAPI, do
NotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, userGesture,
callback) | 586 _evaluateGlobal: function(expression, objectGroup, includeCommandLineAPI, si
lent, returnByValue, generatePreview, userGesture, callback) |
587 { | 587 { |
588 if (!expression) { | 588 if (!expression) { |
589 // There is no expression, so the completion should happen against g
lobal properties. | 589 // There is no expression, so the completion should happen against g
lobal properties. |
590 expression = "this"; | 590 expression = "this"; |
591 } | 591 } |
592 | 592 |
593 /** | 593 /** |
594 * @this {WebInspector.ExecutionContext} | 594 * @this {WebInspector.ExecutionContext} |
595 * @param {?Protocol.Error} error | 595 * @param {?Protocol.Error} error |
596 * @param {!RuntimeAgent.RemoteObject} result | 596 * @param {!RuntimeAgent.RemoteObject} result |
597 * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails | 597 * @param {!RuntimeAgent.ExceptionDetails=} exceptionDetails |
598 */ | 598 */ |
599 function evalCallback(error, result, exceptionDetails) | 599 function evalCallback(error, result, exceptionDetails) |
600 { | 600 { |
601 if (error) { | 601 if (error) { |
602 console.error(error); | 602 console.error(error); |
603 callback(null); | 603 callback(null); |
604 return; | 604 return; |
605 } | 605 } |
606 callback(this.runtimeModel.createRemoteObject(result), exceptionDeta
ils); | 606 callback(this.runtimeModel.createRemoteObject(result), exceptionDeta
ils); |
607 } | 607 } |
608 this.target().runtimeAgent().evaluate(expression, objectGroup, includeCo
mmandLineAPI, doNotPauseOnExceptionsAndMuteConsole, this.id, returnByValue, gene
ratePreview, userGesture, false, evalCallback.bind(this)); | 608 this.target().runtimeAgent().evaluate(expression, objectGroup, includeCo
mmandLineAPI, silent, this.id, returnByValue, generatePreview, userGesture, fals
e, evalCallback.bind(this)); |
609 }, | 609 }, |
610 | 610 |
611 /** | 611 /** |
612 * @param {string} expressionString | 612 * @param {string} expressionString |
613 * @param {string} prefix | 613 * @param {string} prefix |
614 * @param {boolean} force | 614 * @param {boolean} force |
615 * @param {function(!Array.<string>, number=)} completionsReadyCallback | 615 * @param {function(!Array.<string>, number=)} completionsReadyCallback |
616 */ | 616 */ |
617 completionsForExpression: function(expressionString, prefix, force, completi
onsReadyCallback) | 617 completionsForExpression: function(expressionString, prefix, force, completi
onsReadyCallback) |
618 { | 618 { |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 /** | 1022 /** |
1023 * @return {boolean} | 1023 * @return {boolean} |
1024 */ | 1024 */ |
1025 isNormalListenerType: function() | 1025 isNormalListenerType: function() |
1026 { | 1026 { |
1027 return this._listenerType === "normal"; | 1027 return this._listenerType === "normal"; |
1028 }, | 1028 }, |
1029 | 1029 |
1030 __proto__: WebInspector.SDKObject.prototype | 1030 __proto__: WebInspector.SDKObject.prototype |
1031 } | 1031 } |
OLD | NEW |