Permalink
Browse files

Do not leak `links` and `last` variables into global scope.

  • Loading branch information...
1 parent b0feb48 commit 5adca559416d1f41c2347f8494dbb20b8d08096d @NV committed Feb 7, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 chrome/devtools.html
View
@@ -47,9 +47,10 @@
function updateLastStylesheet() {
lastStylesheet = null;
- chrome.devtools.inspectedWindow.eval('var links = document.querySelectorAll("link[rel=stylesheet][href]");\n\
+ chrome.devtools.inspectedWindow.eval('(function() {\n\
+ var links = document.querySelectorAll("link[rel=stylesheet][href]");\n\
var last = links && links.length && links[links.length - 1];\n\
- last && last.href', function(href, fail) {
+ return last && last.href})()', function(href, fail) {
if (fail) return;
chrome.devtools.inspectedWindow.getResources(function(resources) {
var i = resources.length;

0 comments on commit 5adca55

Please sign in to comment.