Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: third_party/WebKit/WebCore/inspector/front-end/Console.js

Issue 13705: Do not access WebInspector.panels.scripts panel while it's disabled in Chrome... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 var result; 260 var result;
261 if (expressionString) { 261 if (expressionString) {
262 try { 262 try {
263 result = this._evalInInspectedWindow(expressionString); 263 result = this._evalInInspectedWindow(expressionString);
264 } catch(e) { 264 } catch(e) {
265 // Do nothing, the prefix will be considered a window property. 265 // Do nothing, the prefix will be considered a window property.
266 } 266 }
267 } else { 267 } else {
268 // There is no expressionString, so the completion should happen aga inst global properties. 268 // There is no expressionString, so the completion should happen aga inst global properties.
269 // Or if the debugger is paused, against properties in scope of the selected call frame. 269 // Or if the debugger is paused, against properties in scope of the selected call frame.
270 if (WebInspector.panels.scripts.paused) 270 if (WebInspector.panels.scripts && WebInspector.panels.scripts.pause d)
271 result = WebInspector.panels.scripts.variablesInScopeForSelected CallFrame(); 271 result = WebInspector.panels.scripts.variablesInScopeForSelected CallFrame();
272 else 272 else
273 result = InspectorController.inspectedWindow(); 273 result = InspectorController.inspectedWindow();
274 } 274 }
275 275
276 if (bracketNotation) { 276 if (bracketNotation) {
277 if (prefix.length && prefix[0] === "'") 277 if (prefix.length && prefix[0] === "'")
278 var quoteUsed = "'"; 278 var quoteUsed = "'";
279 else 279 else
280 var quoteUsed = "\""; 280 var quoteUsed = "\"";
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 { 387 {
388 WebInspector.elementDragEnd(event); 388 WebInspector.elementDragEnd(event);
389 389
390 delete this._statusBarDragOffset; 390 delete this._statusBarDragOffset;
391 391
392 event.stopPropagation(); 392 event.stopPropagation();
393 }, 393 },
394 394
395 _evalInInspectedWindow: function(expression) 395 _evalInInspectedWindow: function(expression)
396 { 396 {
397 if (WebInspector.panels.scripts.paused) 397 if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused)
398 return WebInspector.panels.scripts.evaluateInSelectedCallFrame(expre ssion); 398 return WebInspector.panels.scripts.evaluateInSelectedCallFrame(expre ssion);
399
400 var inspectedWindow = InspectorController.inspectedWindow(); 399 var inspectedWindow = InspectorController.inspectedWindow();
401 if (!inspectedWindow._inspectorCommandLineAPI) { 400 if (!inspectedWindow._inspectorCommandLineAPI) {
402 inspectedWindow.eval("window._inspectorCommandLineAPI = { \ 401 inspectedWindow.eval("window._inspectorCommandLineAPI = { \
403 $: function() { return document.getElementById.apply(document, a rguments) }, \ 402 $: function() { return document.getElementById.apply(document, a rguments) }, \
404 $$: function() { return document.querySelectorAll.apply(document , arguments) }, \ 403 $$: function() { return document.querySelectorAll.apply(document , arguments) }, \
405 $x: function(xpath, context) { \ 404 $x: function(xpath, context) { \
406 var nodes = []; \ 405 var nodes = []; \
407 try { \ 406 try { \
408 var doc = context || document; \ 407 var doc = context || document; \
409 var results = doc.evaluate(xpath, doc, null, XPathResult .ANY_TYPE, null); \ 408 var results = doc.evaluate(xpath, doc, null, XPathResult .ANY_TYPE, null); \
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 groupElement.removeStyleClass("collapsed"); 928 groupElement.removeStyleClass("collapsed");
930 else 929 else
931 groupElement.addStyleClass("collapsed"); 930 groupElement.addStyleClass("collapsed");
932 groupTitleElement.scrollIntoViewIfNeeded(true); 931 groupTitleElement.scrollIntoViewIfNeeded(true);
933 } 932 }
934 933
935 event.stopPropagation(); 934 event.stopPropagation();
936 event.preventDefault(); 935 event.preventDefault();
937 } 936 }
938 } 937 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698