title: ReferenceError: TextEncoder is not defined
body: <p>I'm writing a simple addon in Firefox - 24, on Linux.
  I get the error:</p>
  
  <pre><code>ReferenceError: TextEncoder is not defined
  </code></pre>
  
  <p>when I do: var encoder = new TextEncoder();
  the function I'm using is:</p>
  
  <pre><code>function write_text(filename, text) {
      var encoder = new TextEncoder();
      var data = encoder.encode(text);
      Task.spawn(function() {
         let pfh =  OS.File.open("/tmp/foo", {append: true});
         yield pfh.write(text);
         yield pfh.flush();
         yield pfh.close(); 
      });
  }
  </code></pre>