Firebug frantically tells me that my variable is undefined

I set a breakpoint in the code below that says "breakpoint". Also adding a watch expression for the data store.

function(){
  var self = {};
  var dataStore = [];
  var areEq = UNAB.objectsAreEqual;

  self.put = function(key, value){
    /*breakpoint*/ dataStore.push({key:key, value:value});
  }
  return self;
}

At this breakpoint, Firebug tells me that "ReferenceError: dataStore is not defined." The same results with an attempt to learn "areEq". However, dataStore.push is executed without errors. An additional oddity: adding a clock expression for โ€œIโ€ does not show the object itself, which I expect, with one โ€œputโ€ property, but โ€œwindow objectโ€.

Any idea what is going on?

+5
source share
2 answers

, firefox. var dataStore = []; , put(). ( Firebug 1.6). dataStore self. , Firefox , , : dataStore.

http://getfirebug.com/tests/script/stackoverflow/dataStoreIsNotDefined.html

. https://developer.mozilla.org/en/DOM/window.self

+1

, self Firebug , , Firefox , . , "", .

+1

All Articles