Changeset 121673 in webkit
- Timestamp:
- Jul 2, 2012 5:51:57 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r121669 r121673 1 2012-06-22 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Implement snippets evaluation. 4 https://bugs.webkit.org/show_bug.cgi?id=88707 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/debugger/script-snippet-model-expected.txt: 9 * inspector/debugger/script-snippet-model.html: 10 1 11 2012-07-02 Christophe Dumez <christophe.dumez@intel.com> 2 12 -
trunk/LayoutTests/inspector/debugger/script-snippet-model-expected.txt
r117065 r121673 4 4 5 5 Running: testEvaluate 6 Last evaluation source url for snippet: snippets://1_1 7 Snippet script added, sourceURL = snippets://1_1 8 Last evaluation source url for snippet: snippets://2_2 9 Snippet script added, sourceURL = snippets://2_2 10 Last evaluation source url for snippet: snippets://1_3 11 Snippet script added, sourceURL = snippets://1_3 6 Last evaluation source url for snippet: snippets:///1_1 7 Snippet script added, sourceURL = snippets:///1_1 8 Snippet execution result: undefined 9 Last evaluation source url for snippet: snippets:///2_2 10 Snippet script added, sourceURL = snippets:///2_2 11 Snippet execution result: function doesNothing() 12 { 13 var i = 2+2; 14 } 15 Last evaluation source url for snippet: snippets:///1_3 16 Snippet script added, sourceURL = snippets:///1_3 17 Snippet execution result: undefined 12 18 Debugger was disabled. 13 19 -
trunk/LayoutTests/inspector/debugger/script-snippet-model.html
r117299 r121673 27 27 content += "// This snippet does nothing.\n"; 28 28 content += "var i = 2+2;\n"; 29 WebInspector.scriptSnippetModel. setScriptSnippetContent(snippetJavaScriptSource1, content);29 WebInspector.scriptSnippetModel._setScriptSnippetContent(snippetJavaScriptSource1, content); 30 30 31 31 var snippetJavaScriptSource2 = WebInspector.scriptSnippetModel.createScriptSnippet(); 32 32 WebInspector.scriptSnippetModel.renameScriptSnippet(snippetJavaScriptSource2, "Snippet2"); 33 33 content = ""; 34 content += "// This snippet creates a function that does nothing .\n";34 content += "// This snippet creates a function that does nothing and returns it.\n"; 35 35 content += "function doesNothing()\n"; 36 36 content += "{\n"; 37 37 content += " var i = 2+2;\n"; 38 content += "}\n"; 39 WebInspector.scriptSnippetModel.setScriptSnippetContent(snippetJavaScriptSource2, content); 38 content += "};\n"; 39 content += "doesNothing;\n"; 40 WebInspector.scriptSnippetModel._setScriptSnippetContent(snippetJavaScriptSource2, content); 40 41 41 42 function evaluateSnippetAndDumpEvaluationDetails(snippetJavaScriptSource, callback) 42 43 { 43 44 InspectorTest.addSniffer(WebInspector.SnippetScriptMapping.prototype, "addScript", dumpScript); 45 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_printResult", dumpResult); 44 46 WebInspector.scriptSnippetModel.evaluateScriptSnippet(snippetJavaScriptSource); 45 var snippet = WebInspector.scriptSnippetModel._snippetStorage.snippetForId(snippetJavaScriptSource.snippetId); 46 InspectorTest.addResult("Last evaluation source url for snippet: " + snippet._lastEvaluationSourceURL); 47 InspectorTest.assertEquals(snippet, WebInspector.scriptSnippetModel._snippetForSourceURL(snippet._lastEvaluationSourceURL), "Snippet can not be identified by its evaluation sourceURL."); 47 var evaluationSourceURL = WebInspector.scriptSnippetModel._evaluationSourceURL(snippetJavaScriptSource); 48 var snippetId = snippetJavaScriptSource.snippetId; 49 InspectorTest.addResult("Last evaluation source url for snippet: " + evaluationSourceURL); 50 InspectorTest.assertEquals(snippetId, WebInspector.scriptSnippetModel._snippetIdForSourceURL(evaluationSourceURL), "Snippet can not be identified by its evaluation sourceURL."); 48 51 49 52 function dumpScript(script) 50 53 { 51 54 InspectorTest.addResult("Snippet script added, sourceURL = " + script.sourceURL); 55 } 56 57 function dumpResult(result, wasThrown) 58 { 59 InspectorTest.addResult("Snippet execution result: " + result.description); 52 60 callback(); 53 61 } -
trunk/Source/WebCore/ChangeLog
r121672 r121673 1 2012-06-22 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Implement snippets evaluation. 4 https://bugs.webkit.org/show_bug.cgi?id=88707 5 6 Reviewed by Pavel Feldman. 7 8 Implemented snippet evaluation and adjusted breakpoints behavior when editing snippet. 9 Snippets are evaluated using separate compile and run. 10 Breakpoints are updated after compilation (once scriptId is available they can be set in debugger). 11 If separate compile and run is not supported by port or debugger is paused we fall back to evaluation in console. 12 13 * inspector/front-end/ConsoleView.js: 14 (WebInspector.ConsoleView.prototype.runScript.runCallback): 15 (WebInspector.ConsoleView.prototype.runScript): 16 (WebInspector.ConsoleView.prototype._printResult): 17 * inspector/front-end/JavaScriptSource.js: 18 (WebInspector.JavaScriptSource.prototype.supportsEnabledBreakpointsWhileEditing): 19 * inspector/front-end/JavaScriptSourceFrame.js: 20 (WebInspector.JavaScriptSourceFrame.prototype.afterTextChanged): 21 (WebInspector.JavaScriptSourceFrame.prototype.beforeTextChanged): 22 (WebInspector.JavaScriptSourceFrame.prototype._didEditContent): 23 (WebInspector.JavaScriptSourceFrame.prototype._removeBreakpointsBeforeEditing): 24 (WebInspector.JavaScriptSourceFrame.prototype._restoreBreakpointsAfterEditing): 25 (WebInspector.JavaScriptSourceFrame.prototype._addBreakpointDecoration): 26 (WebInspector.JavaScriptSourceFrame.prototype._onMouseDown): 27 * inspector/front-end/ScriptSnippetModel.js: 28 (WebInspector.ScriptSnippetModel.prototype.deleteScriptSnippet): 29 (WebInspector.ScriptSnippetModel.prototype._setScriptSnippetContent): 30 (WebInspector.ScriptSnippetModel.prototype.evaluateScriptSnippet.compileCallback): 31 (WebInspector.ScriptSnippetModel.prototype.evaluateScriptSnippet): 32 (WebInspector.ScriptSnippetModel.prototype._rawLocationToUILocation): 33 (WebInspector.ScriptSnippetModel.prototype._removeBreakpoints): 34 (WebInspector.ScriptSnippetModel.prototype._restoreBreakpoints): 35 (WebInspector.ScriptSnippetModel.prototype._evaluationSourceURL): 36 (WebInspector.SnippetJavaScriptSource.prototype.isDivergedFromVM): 37 (WebInspector.SnippetJavaScriptSource.prototype.workingCopyCommitted): 38 (WebInspector.SnippetJavaScriptSource.prototype.workingCopyChanged): 39 (WebInspector.SnippetJavaScriptSource.prototype.evaluate): 40 (WebInspector.SnippetJavaScriptSource.prototype.supportsEnabledBreakpointsWhileEditing): 41 (WebInspector.SnippetJavaScriptSource.prototype.breakpointStorageId): 42 * inspector/front-end/ScriptsNavigator.js: 43 (WebInspector.SnippetsNavigatorView.prototype._handleEvaluateSnippet): 44 1 45 2012-06-26 Vsevolod Vlasov <vsevik@chromium.org> 2 46 -
trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
r121538 r121673 452 452 void ScriptDebugServer::runScript(ScriptState* state, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage) 453 453 { 454 if (!m_compiledScripts.contains(scriptId)) 455 return; 454 456 v8::HandleScope handleScope; 455 457 OwnHandle<v8::Script>* scriptOwnHandle = m_compiledScripts.get(scriptId); -
trunk/Source/WebCore/inspector/front-end/ConsoleView.js
r120325 r121673 713 713 }, 714 714 715 runScript: function(scriptId) 716 { 717 var contextId = WebInspector.consoleView._currentEvaluationContextId(); 718 DebuggerAgent.runScript(scriptId, contextId, "console", false, runCallback.bind(this)); 719 WebInspector.userMetrics.ConsoleEvaluated.record(); 720 721 /** 722 * @param {?string} error 723 * @param {?RuntimeAgent.RemoteObject} result 724 * @param {boolean=} wasThrown 725 */ 726 function runCallback(error, result, wasThrown) 727 { 728 if (error) { 729 console.error(error); 730 return; 731 } 732 733 this._printResult(result, wasThrown); 734 } 735 }, 736 737 _printResult: function(result, wasThrown) 738 { 739 if (!result) 740 return; 741 742 this._appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, null, this._linkifier)); 743 }, 744 715 745 _appendCommand: function(text, newPromptText, useCommandLineAPI, showResultOnly) 716 746 { … … 731 761 WebInspector.settings.consoleHistory.set(this.prompt.historyData.slice(-30)); 732 762 } 733 734 this._ appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage, this._linkifier));763 764 this._printResult(result, wasThrown); 735 765 } 736 766 this.evalInInspectedWindow(text, "console", useCommandLineAPI, false, false, printResult.bind(this)); -
trunk/Source/WebCore/inspector/front-end/JavaScriptSource.js
r120471 r121673 161 161 162 162 /** 163 * @return {boolean} 164 */ 165 supportsEnabledBreakpointsWhileEditing: function() 166 { 167 return false; 168 }, 169 170 /** 163 171 * @return {string} 164 172 */ … … 189 197 */ 190 198 workingCopyCommitted: function(callback) 191 { 199 { 192 200 /** 193 201 * @param {?string} error -
trunk/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
r121535 r121673 150 150 afterTextChanged: function(oldRange, newRange) 151 151 { 152 WebInspector.SourceFrame.prototype.afterTextChanged.call(this, oldRange, newRange); 152 153 this._javaScriptSource.setWorkingCopy(this.textModel.text); 153 if (!this._javaScriptSource.isDirty()) 154 this._didEditContent(null); 154 this._restoreBreakpointsAfterEditing(); 155 155 }, 156 156 157 157 beforeTextChanged: function() 158 158 { 159 if (!this._javaScriptSource.isDirty()) { 159 WebInspector.SourceFrame.prototype.beforeTextChanged.call(this); 160 this._removeBreakpointsBeforeEditing(); 161 }, 162 163 _didEditContent: function(error) 164 { 165 delete this._isCommittingEditing; 166 167 if (error) { 168 WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true); 169 return; 170 } 171 if (!this._javaScriptSource.supportsEnabledBreakpointsWhileEditing()) 172 this._restoreBreakpointsAfterEditing(); 173 }, 174 175 _removeBreakpointsBeforeEditing: function() 176 { 177 if (!this._javaScriptSource.isDirty() || this._javaScriptSource.supportsEnabledBreakpointsWhileEditing()) { 160 178 // Disable all breakpoints in the model, store them as muted breakpoints. 161 179 var breakpointLocations = this._breakpointManager.breakpointLocationsForUISourceCode(this._javaScriptSource); … … 169 187 this.clearExecutionLine(); 170 188 } 171 172 WebInspector.SourceFrame.prototype.beforeTextChanged.call(this); 173 }, 174 175 _didEditContent: function(error) 176 { 177 delete this._isCommittingEditing; 178 179 if (error) { 180 WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true); 181 return; 182 } 183 184 // Restore all muted breakpoints. 185 for (var lineNumber = 0; lineNumber < this.textModel.linesCount; ++lineNumber) { 186 var breakpointDecoration = this.textModel.getAttribute(lineNumber, "breakpoint"); 187 if (breakpointDecoration) { 188 // Remove fake decoration 189 this._removeBreakpointDecoration(lineNumber); 190 // Set new breakpoint 191 this._setBreakpoint(lineNumber, breakpointDecoration.condition, breakpointDecoration.enabled); 189 }, 190 191 _restoreBreakpointsAfterEditing: function() 192 { 193 if (!this._javaScriptSource.isDirty() || this._javaScriptSource.supportsEnabledBreakpointsWhileEditing()) { 194 // Restore all muted breakpoints. 195 for (var lineNumber = 0; lineNumber < this.textModel.linesCount; ++lineNumber) { 196 var breakpointDecoration = this.textModel.getAttribute(lineNumber, "breakpoint"); 197 if (breakpointDecoration) { 198 // Remove fake decoration 199 this._removeBreakpointDecoration(lineNumber); 200 // Set new breakpoint 201 this._setBreakpoint(lineNumber, breakpointDecoration.condition, breakpointDecoration.enabled); 202 } 192 203 } 193 204 } … … 327 338 this.textViewer.beginUpdates(); 328 339 this.textViewer.addDecoration(lineNumber, "webkit-breakpoint"); 329 if (!enabled || mutedWhileEditing)340 if (!enabled || (mutedWhileEditing && !this._javaScriptSource.supportsEnabledBreakpointsWhileEditing())) 330 341 this.textViewer.addDecoration(lineNumber, "webkit-breakpoint-disabled"); 331 342 else … … 350 361 _onMouseDown: function(event) 351 362 { 352 if (this._javaScriptSource.isDirty() )363 if (this._javaScriptSource.isDirty() && !this._javaScriptSource.supportsEnabledBreakpointsWhileEditing()) 353 364 return; 354 365 -
trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js
r119898 r121673 48 48 } 49 49 50 WebInspector.ScriptSnippetModel.evaluatedSnippetExtraLinesCount = 2; 51 WebInspector.ScriptSnippetModel.snippetSourceURLPrefix = "snippets://"; 50 WebInspector.ScriptSnippetModel.snippetSourceURLPrefix = "snippets:///"; 52 51 53 52 WebInspector.ScriptSnippetModel.prototype = { … … 88 87 var snippet = this._snippetStorage.snippetForId(snippetJavaScriptSource.snippetId); 89 88 this._snippetStorage.deleteSnippet(snippet); 89 this._removeBreakpoints(snippetJavaScriptSource); 90 90 this._releaseSnippetScript(snippetJavaScriptSource); 91 91 delete this._snippetJavaScriptSourceForSnippetId[snippet.id]; … … 108 108 /** 109 109 * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource 110 * @return {boolean} 111 */ 112 _isDivergedFromVM: function(snippetJavaScriptSource) 113 { 114 var script = this._scriptForUISourceCode.get(snippetJavaScriptSource); 115 return !script; 116 }, 117 118 /** 119 * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource 110 120 * @param {string} newContent 111 121 */ 112 setScriptSnippetContent: function(snippetJavaScriptSource, newContent)122 _setScriptSnippetContent: function(snippetJavaScriptSource, newContent) 113 123 { 114 124 var snippet = this._snippetStorage.snippetForId(snippetJavaScriptSource.snippetId); … … 120 130 * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource 121 131 */ 122 evaluateScriptSnippet: function(snippetJavaScriptSource) 123 { 132 _scriptSnippetEdited: function(snippetJavaScriptSource) 133 { 134 var script = this._scriptForUISourceCode.get(snippetJavaScriptSource); 135 if (!script) 136 return; 137 138 var breakpointLocations = this._removeBreakpoints(snippetJavaScriptSource); 124 139 this._releaseSnippetScript(snippetJavaScriptSource); 140 this._restoreBreakpoints(snippetJavaScriptSource, breakpointLocations); 141 }, 142 143 /** 144 * @param {string} snippetId 145 * @return {number} 146 */ 147 _nextEvaluationIndex: function(snippetId) 148 { 125 149 var evaluationIndex = this._lastSnippetEvaluationIndexSetting.get() + 1; 126 150 this._lastSnippetEvaluationIndexSetting.set(evaluationIndex); 127 128 var snippet = this._snippetStorage.snippetForId(snippetJavaScriptSource.snippetId); 129 var sourceURL = this._sourceURLForSnippet(snippet, evaluationIndex); 130 snippet._lastEvaluationSourceURL = sourceURL; 131 var expression = "\n//@ sourceURL=" + sourceURL + "\n" + snippet.content; 132 WebInspector.evaluateInConsole(expression, true); 151 return evaluationIndex; 152 }, 153 154 /** 155 * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource 156 */ 157 evaluateScriptSnippet: function(snippetJavaScriptSource) 158 { 159 var breakpointLocations = this._removeBreakpoints(snippetJavaScriptSource); 160 this._releaseSnippetScript(snippetJavaScriptSource); 161 this._restoreBreakpoints(snippetJavaScriptSource, breakpointLocations); 162 var evaluationIndex = this._nextEvaluationIndex(snippetJavaScriptSource.snippetId); 163 snippetJavaScriptSource._evaluationIndex = evaluationIndex; 164 var evaluationUrl = this._evaluationSourceURL(snippetJavaScriptSource); 165 166 var expression = snippetJavaScriptSource.workingCopy(); 167 168 // In order to stop on the breakpoints during the snippet evaluation we need to compile and run it separately. 169 // If separate compilation and execution is not supported by the port we fall back to evaluation in console. 170 // In case we don't need that since debugger is already paused. 171 // We do the same when we are stopped on the call frame since debugger is already paused and can not stop on breakpoint anymore. 172 if (WebInspector.debuggerModel.selectedCallFrame() || !Capabilities.separateScriptCompilationAndExecutionEnabled) { 173 expression = snippetJavaScriptSource.workingCopy() + "\n//@ sourceURL=" + snippetJavaScriptSource.url + "\n"; 174 WebInspector.evaluateInConsole(expression, true); 175 return; 176 } 177 178 WebInspector.showConsole(); 179 DebuggerAgent.compileScript(expression, evaluationUrl, compileCallback.bind(this)); 180 181 /** 182 * @param {?string} error 183 * @param {string=} scriptId 184 * @param {string=} syntaxErrorMessage 185 */ 186 function compileCallback(error, scriptId, syntaxErrorMessage) 187 { 188 if (!snippetJavaScriptSource || snippetJavaScriptSource._evaluationIndex !== evaluationIndex) 189 return; 190 191 if (error) { 192 console.error(error); 193 return; 194 } 195 196 if (!scriptId) { 197 var consoleMessage = WebInspector.ConsoleMessage.create( 198 WebInspector.ConsoleMessage.MessageSource.JS, 199 WebInspector.ConsoleMessage.MessageLevel.Error, 200 syntaxErrorMessage || "", 201 WebInspector.ConsoleMessage.MessageType.Log, 202 "", 0, 1, null, null, null); 203 WebInspector.console.addMessage(consoleMessage); 204 return; 205 } 206 207 var breakpointLocations = this._removeBreakpoints(snippetJavaScriptSource); 208 this._restoreBreakpoints(snippetJavaScriptSource, breakpointLocations); 209 210 WebInspector.consoleView.runScript(scriptId); 211 } 133 212 }, 134 213 … … 140 219 { 141 220 var uiSourceCode = this._uiSourceCodeForScriptId[rawLocation.scriptId]; 142 if (uiSourceCode.isSnippet) {143 var uiLineNumber = rawLocation.lineNumber - WebInspector.ScriptSnippetModel.evaluatedSnippetExtraLinesCount;144 return new WebInspector.UILocation(uiSourceCode, uiLineNumber, rawLocation.columnNumber || 0);145 }146 147 221 return new WebInspector.UILocation(uiSourceCode, rawLocation.lineNumber, rawLocation.columnNumber || 0); 148 222 }, … … 159 233 if (!script) 160 234 return null; 161 162 if (uiSourceCode.isSnippet) {163 var rawLineNumber = lineNumber + WebInspector.ScriptSnippetModel.evaluatedSnippetExtraLinesCount;164 return WebInspector.debuggerModel.createRawLocation(script, rawLineNumber, columnNumber);165 }166 235 167 236 return WebInspector.debuggerModel.createRawLocation(script, lineNumber, columnNumber); … … 200 269 var snippetId = this._snippetIdForSourceURL(script.sourceURL); 201 270 var snippetJavaScriptSource = this._snippetJavaScriptSourceForSnippetId[snippetId]; 202 if (!snippetJavaScriptSource) { 271 272 if (!snippetJavaScriptSource || this._evaluationSourceURL(snippetJavaScriptSource) !== script.sourceURL) { 203 273 this._createUISourceCodeForScript(script); 204 274 return; … … 226 296 /** 227 297 * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource 298 * @return {Array.<Object>} 299 */ 300 _removeBreakpoints: function(snippetJavaScriptSource) 301 { 302 var breakpointLocations = WebInspector.breakpointManager.breakpointLocationsForUISourceCode(snippetJavaScriptSource); 303 for (var i = 0; i < breakpointLocations.length; ++i) 304 breakpointLocations[i].breakpoint.remove(); 305 return breakpointLocations; 306 }, 307 308 /** 309 * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource 310 * @param {Array.<Object>} breakpointLocations 311 */ 312 _restoreBreakpoints: function(snippetJavaScriptSource, breakpointLocations) 313 { 314 for (var i = 0; i < breakpointLocations.length; ++i) { 315 var uiLocation = breakpointLocations[i].uiLocation; 316 var breakpoint = breakpointLocations[i].breakpoint; 317 WebInspector.breakpointManager.setBreakpoint(uiLocation.uiSourceCode, uiLocation.lineNumber, breakpoint.condition(), breakpoint.enabled()); 318 } 319 }, 320 321 /** 322 * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource 228 323 */ 229 324 _releaseSnippetScript: function(snippetJavaScriptSource) … … 235 330 delete this._uiSourceCodeForScriptId[script.scriptId]; 236 331 this._scriptForUISourceCode.remove(snippetJavaScriptSource); 237 332 delete snippetJavaScriptSource._evaluationIndex; 238 333 this._createUISourceCodeForScript(script); 239 334 }, 240 335 241 336 /** 242 * @param {WebInspector.Snippet} snippet 243 * @param {string} evaluationIndex 337 * @param {WebInspector.SnippetJavaScriptSource} snippetJavaScriptSource 244 338 * @return {string} 245 339 */ 246 _ sourceURLForSnippet: function(snippet, evaluationIndex)340 _evaluationSourceURL: function(snippetJavaScriptSource) 247 341 { 248 342 var snippetPrefix = WebInspector.ScriptSnippetModel.snippetSourceURLPrefix; 249 var evaluationSuffix = evaluationIndex ? "_" + evaluationIndex : "";250 return snippetPrefix + snippet .id + evaluationSuffix;343 var evaluationSuffix = "_" + snippetJavaScriptSource._evaluationIndex; 344 return snippetPrefix + snippetJavaScriptSource.snippetId + evaluationSuffix; 251 345 }, 252 346 … … 263 357 var snippetId = splittedURL[0]; 264 358 return snippetId; 265 },266 267 /**268 * @param {string} sourceURL269 * @return {WebInspector.Snippet|null}270 */271 _snippetForSourceURL: function(sourceURL)272 {273 var snippetId = this._snippetIdForSourceURL(sourceURL);274 if (!snippetId)275 return null;276 var snippet = this._snippetStorage.snippetForId(snippetId);277 if (!snippet || snippet._lastEvaluationSourceURL !== sourceURL)278 return null;279 return snippet;280 359 }, 281 360 … … 318 397 319 398 /** 399 * @return {boolean} 400 */ 401 isDivergedFromVM: function() 402 { 403 return this._scriptSnippetModel._isDivergedFromVM(this); 404 }, 405 406 /** 320 407 * @param {function(?string)} callback 321 408 */ 322 409 workingCopyCommitted: function(callback) 323 410 { 324 this._scriptSnippetModel. setScriptSnippetContent(this, this.workingCopy());411 this._scriptSnippetModel._setScriptSnippetContent(this, this.workingCopy()); 325 412 callback(null); 413 }, 414 415 workingCopyChanged: function() 416 { 417 this._scriptSnippetModel._scriptSnippetEdited(this); 418 }, 419 420 evaluate: function() 421 { 422 this._scriptSnippetModel.evaluateScriptSnippet(this); 423 }, 424 425 /** 426 * @return {boolean} 427 */ 428 supportsEnabledBreakpointsWhileEditing: function() 429 { 430 return true; 431 }, 432 433 /** 434 * @return {string} 435 */ 436 breakpointStorageId: function() 437 { 438 return WebInspector.ScriptSnippetModel.snippetSourceURLPrefix + this.snippetId; 326 439 }, 327 440 -
trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js
r117751 r121673 233 233 _handleEvaluateSnippet: function(uiSourceCode, event) 234 234 { 235 // FIXME: To be implemented. 235 if (!uiSourceCode.isSnippet) 236 return; 237 var snippetJavaScriptSource = /** @type {WebInspector.SnippetJavaScriptSource} */ uiSourceCode; 238 snippetJavaScriptSource.evaluate(); 236 239 }, 237 240 -
trunk/Source/WebCore/inspector/front-end/externs.js
r120085 r121673 148 148 WebInspector.openResource = function(url, external) {} 149 149 150 WebInspector.showConsole = function() {} 151 150 152 /** 151 153 * @param {string} expression
Note: See TracChangeset
for help on using the changeset viewer.