title: Transformation to another object returns undefined
body: <p>Im experementing with chrome apps and try to read from a file that is contained in the directory the user selects. So far it works good, the user selects a file and afterwards the single File Entry objects are printed into my console:</p>
  
  <p><b>Code:</b></p>
  
  <pre><code>         for (var i = 0; i &lt; entries.length; ++i) {
              console.log("entry is " + entries[i]);
              a = entries[i].file(callback);    
            }
  </code></pre>
  
  <p><b>Console:</b></p>
  
  <pre><code>       entry is [object FileEntry] window.js:18
         entry is [object FileEntry]
         ......
  </code></pre>
  
  <p>So how you can see from the console <code>entries[i]</code> is a <code>FileEntry</code> object.
  To read from a <code>FileEntry</code> i first have to transform it to a <code>File</code> object.
  In the docu for the FileEntry: <a href="https://developer.mozilla.org/en-US/docs/Web/API/FileEntry#File" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/FileEntry#File</a> I read that there is a function           <code>void file(
    FileCallback successCallback, optional ErrorCallback errorCallback
  );</code> That returns a file object.</p>
  
  <p>How you can see in the <b>Code</b> form above i try to achieve this with that:</p>
  
  <pre><code>    a = entries[i].file(callback); 
  ......
  
  var callback = function(){
      console.log("it works");
      console.log(a); 
  } 
  </code></pre>
  
  <p><b>My Problem</b> is that <code>console.log(a)</code> does not return <code>object File</code> but instead undefined:</p>
  
  <p><b>Console:</b></p>
  
  <pre><code>entry is [object FileEntry]   window.js:18
  entry is [object FileEntry]   window.js:18
  it works                      window.js:29
  undefined                     window.js:30
  it works                      window.js:29
  undefined 
  </code></pre>
  
  <p><b>What do i wrong? How can i test if it really returns a File Object? Thanks!</b></p>
  
  <p><b>Full Code</b></p>
  
  <pre><code>var callback = function(){
      console.log("it works");
      console.log(a); 
  } 
  
  
  chooseDirButton.addEventListener('click', function(e) {
    chrome.fileSystem.chooseEntry({type: 'openDirectory'}, function(theEntry) {
  
      chrome.fileSystem.getDisplayPath(theEntry, function(path) {
  
      var reader = theEntry.createReader();
  
          reader.readEntries(function(entries) {
            for (var i = 0; i &lt; entries.length; ++i) {
              console.log("entry is " + entries[i]);
              a = entries[i].file(callback);    
            }
          });
  
      });
    });
  });
  </code></pre>