/*global $, jsbin, RSVP, CodeMirror, module, hintingDone */

// var editors = require('../editors/editors');
// var Panels = require('../editors/panels');

module.exports = function () {
  'use strict';

  var formatErrors = function(res) {
    var errors = [];
    var line = 0;
    var ch = 0;
    for (var i = 0; i < res.length; i++) {
      line = res[i].line || 0;
      ch = res[i].ch || 0;
      errors.push({
        from: CodeMirror.Pos(line, ch),
        to: CodeMirror.Pos(line, ch),
        message: res[i].msg,
        severity : 'error'
      });
    }
    return errors;
  };

  function render(language) {
    return new RSVP.Promise(function (resolve, reject) {
      jsbin.panels.panels[language].render().then(resolve, function (error) {
        console.warn(jsbin.panels.panels[language].processor.id + ' processor compilation failed');
        if (!error) {
          error = {};
        }

        if ($.isArray(error)) { // then this is for our hinter
          // console.log(data.errors);
          var cm = jsbin.panels.panels[language].editor;

          // if we have the error reporting function (called updateLinting)
          if (typeof cm.updateLinting !== 'undefined') {
            hintingDone(cm);
            var err = formatErrors(error);
            cm.updateLinting(err);
          } else {
            // otherwise dump to the console
            console.warn(error);
          }
        } else if (error.message) {
          console.warn(error.message, error.stack);
        } else {
          console.warn(error);
        }

        reject(error);
      });
    });
  }

  var promises = {
    html: render('html'),
    javascript: render('javascript'),
    jasmine: render('jasmine'),
    dataframe: render('dataframe'),
    css: render('css')
  };

  console.log(promises.html);
  
  return RSVP.hash(promises);
};

@@ -58,103 +58,8 @@
 */%0A%0A
-// var editors = require('../editors/editors');%0A// var Panels = require('../editors/panels');%0A%0A
 modu
@@ -1696,41 +1696,8 @@
 %7D;%0A%0A
-  console.log(promises.html);%0A  %0A
   re

Remove comments and log