| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 * @param {boolean} includeCommandLineAPI | 268 * @param {boolean} includeCommandLineAPI |
| 269 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole | 269 * @param {boolean} doNotPauseOnExceptionsAndMuteConsole |
| 270 * @param {boolean} returnByValue | 270 * @param {boolean} returnByValue |
| 271 * @param {boolean} generatePreview | 271 * @param {boolean} generatePreview |
| 272 * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.Remot
eObject=, ?DebuggerAgent.ExceptionDetails=)} callback | 272 * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.Remot
eObject=, ?DebuggerAgent.ExceptionDetails=)} callback |
| 273 */ | 273 */ |
| 274 evaluate: function(expression, objectGroup, includeCommandLineAPI, doNotPaus
eOnExceptionsAndMuteConsole, returnByValue, generatePreview, callback) | 274 evaluate: function(expression, objectGroup, includeCommandLineAPI, doNotPaus
eOnExceptionsAndMuteConsole, returnByValue, generatePreview, callback) |
| 275 { | 275 { |
| 276 // Dart adds the isEvaluateOnCallFrameMode option to make debugging mult
iple Dart libraries more usable. | 276 // Dart adds the isEvaluateOnCallFrameMode option to make debugging mult
iple Dart libraries more usable. |
| 277 // FIXME: It will be moved to separate ExecutionContext. | 277 // FIXME: It will be moved to separate ExecutionContext. |
| 278 if (this.debuggerModel.selectedCallFrame() && this._debuggerModel.isEval
uateOnCallFrameMode()) { | 278 if (this.debuggerModel.selectedCallFrame() && this.debuggerModel.isEvalu
ateOnCallFrameMode()) { |
| 279 this.debuggerModel.evaluateOnSelectedCallFrame(expression, objectGro
up, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue,
generatePreview, callback); | 279 this.debuggerModel.evaluateOnSelectedCallFrame(expression, objectGro
up, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue,
generatePreview, callback); |
| 280 return; | 280 return; |
| 281 } | 281 } |
| 282 this._evaluateGlobal.apply(this, arguments); | 282 this._evaluateGlobal.apply(this, arguments); |
| 283 }, | 283 }, |
| 284 | 284 |
| 285 /** | 285 /** |
| 286 * @param {string} objectGroup | 286 * @param {string} objectGroup |
| 287 * @param {boolean} returnByValue | 287 * @param {boolean} returnByValue |
| 288 * @param {boolean} generatePreview | 288 * @param {boolean} generatePreview |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 330 } |
| 331 this.target().runtimeAgent().evaluate(expression, objectGroup, includeCo
mmandLineAPI, doNotPauseOnExceptionsAndMuteConsole, this.id, returnByValue, gene
ratePreview, evalCallback.bind(this)); | 331 this.target().runtimeAgent().evaluate(expression, objectGroup, includeCo
mmandLineAPI, doNotPauseOnExceptionsAndMuteConsole, this.id, returnByValue, gene
ratePreview, evalCallback.bind(this)); |
| 332 }, | 332 }, |
| 333 | 333 |
| 334 /** | 334 /** |
| 335 * @param {string} expression | 335 * @param {string} expression |
| 336 * @param {function(?Protocol.Error, !Array.<!string>)} callback | 336 * @param {function(?Protocol.Error, !Array.<!string>)} callback |
| 337 */ | 337 */ |
| 338 getCompletions: function(expression, callback) | 338 getCompletions: function(expression, callback) |
| 339 { | 339 { |
| 340 var selectedCallFrame = WebInspector.debuggerModel.selectedCallFrame(); | 340 var selectedCallFrame = this.debuggerModel.selectedCallFrame(); |
| 341 | 341 |
| 342 // Dart/Modules specific tweak: don't use the call frame if we are | 342 // Dart/Modules specific tweak: don't use the call frame if we are |
| 343 // we have explicitly selected an execution context for the console | 343 // we have explicitly selected an execution context for the console |
| 344 // that is part of a different library than the current call frame. | 344 // that is part of a different library than the current call frame. |
| 345 | 345 |
| 346 if (selectedCallFrame && this._debuggerModel.isEvaluateOnCallFrameMode()
) { | 346 if (selectedCallFrame && this.debuggerModel.isEvaluateOnCallFrameMode())
{ |
| 347 selectedCallFrame.getCompletions(expression, callback); | 347 selectedCallFrame.getCompletions(expression, callback); |
| 348 return; | 348 return; |
| 349 } | 349 } |
| 350 | 350 |
| 351 this.target().runtimeAgent().getCompletions(expression, this.id, callbac
k); | 351 this.target().runtimeAgent().getCompletions(expression, this.id, callbac
k); |
| 352 }, | 352 }, |
| 353 | 353 |
| 354 /** | 354 /** |
| 355 * @param {string} expressionString | 355 * @param {string} expressionString |
| 356 * @param {string} prefix | 356 * @param {string} prefix |
| 357 * @param {boolean} force | 357 * @param {boolean} force |
| 358 * @param {function(!Array.<string>, number=)} completionsReadyCallback | 358 * @param {function(!Array.<string>, number=)} completionsReadyCallback |
| 359 */ | 359 */ |
| 360 completionsForExpression: function(expressionString, prefix, force, completi
onsReadyCallback) | 360 completionsForExpression: function(expressionString, prefix, force, completi
onsReadyCallback) |
| 361 { | 361 { |
| 362 if ((this._debuggerModel.selectedCallFrame() && this._debuggerModel.sele
ctedCallFrame().script.language == "Dart") || | 362 if ((this.debuggerModel.selectedCallFrame() && this.debuggerModel.select
edCallFrame().script.language == "Dart") || |
| 363 (!this._debuggerModel.selectedCallFrame() && this.language == "Dart"
)) { | 363 (!this.debuggerModel.selectedCallFrame() && this.language == "Dart")
) { |
| 364 return this.completionsForExpressionDart(expressionString, prefix, f
orce, completionsReadyCallback); | 364 return this.completionsForExpressionDart(expressionString, prefix, f
orce, completionsReadyCallback); |
| 365 } | 365 } |
| 366 | 366 |
| 367 var lastIndex = expressionString.length - 1; | 367 var lastIndex = expressionString.length - 1; |
| 368 | 368 |
| 369 var dotNotation = (expressionString[lastIndex] === "."); | 369 var dotNotation = (expressionString[lastIndex] === "."); |
| 370 var bracketNotation = (expressionString[lastIndex] === "["); | 370 var bracketNotation = (expressionString[lastIndex] === "["); |
| 371 | 371 |
| 372 if (dotNotation || bracketNotation) | 372 if (dotNotation || bracketNotation) |
| 373 expressionString = expressionString.substr(0, lastIndex); | 373 expressionString = expressionString.substr(0, lastIndex); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 if (bracketNotation) { | 538 if (bracketNotation) { |
| 539 if (prefix.length && prefix[0] === "'") | 539 if (prefix.length && prefix[0] === "'") |
| 540 var quoteUsed = "'"; | 540 var quoteUsed = "'"; |
| 541 else | 541 else |
| 542 var quoteUsed = "\""; | 542 var quoteUsed = "\""; |
| 543 } | 543 } |
| 544 | 544 |
| 545 var results = []; | 545 var results = []; |
| 546 | 546 |
| 547 if (!expressionString) { | 547 if (!expressionString) { |
| 548 var selectedCallFrame = WebInspector.debuggerModel.selectedCallFrame
(); | 548 var selectedCallFrame = this.debuggerModel.selectedCallFrame(); |
| 549 var dartContext = false; | 549 var dartContext = false; |
| 550 | 550 |
| 551 if (selectedCallFrame) { | 551 if (selectedCallFrame) { |
| 552 dartContext = selectedCallFrame.script && selectedCallFrame.scri
pt.language == "Dart"; | 552 dartContext = selectedCallFrame.script && selectedCallFrame.scri
pt.language == "Dart"; |
| 553 } else { | 553 } else { |
| 554 dartContext = this.language == "Dart"; | 554 dartContext = this.language == "Dart"; |
| 555 } | 555 } |
| 556 | 556 |
| 557 if (dartContext) { | 557 if (dartContext) { |
| 558 // Note we omit get, set, final, class, import, and library as t
hose | 558 // Note we omit get, set, final, class, import, and library as t
hose |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 /** | 659 /** |
| 660 * @return {!RuntimeAgent.RemoteObjectId} | 660 * @return {!RuntimeAgent.RemoteObjectId} |
| 661 */ | 661 */ |
| 662 objectId: function() | 662 objectId: function() |
| 663 { | 663 { |
| 664 return this._objectId; | 664 return this._objectId; |
| 665 }, | 665 }, |
| 666 | 666 |
| 667 __proto__: WebInspector.SDKObject.prototype | 667 __proto__: WebInspector.SDKObject.prototype |
| 668 } | 668 } |
| OLD | NEW |