/**
 * mozillaParser.js
 * Andrea Tino - 2015
 */

/**
 * Mozilla parser.
 */
module.exports = function() {
  var spawn = require('child_process').spawnSync;

  var path2MozJs = '../../deps/mozjs/mozjs-unix-rhel';

  return {
    /**
     * Parses a file and returns AST.
     * filepath: Absolute path to file.
     */
    parse: function(filepath) {
      var par = '--file=' + filepath;
      var ret = spawn(path2MozJs, [par]);
      if (!ret) {
        throw 'Error invoking: ' + path2MozJs + '!';
      }

      // Process returned synchronously
      var ast = ret.stdout
      if (!ast) {
        throw 'Error retrieving output from parser process!';
      }

      return ast;
    }
  };
};


@@ -107,21 +107,24 @@
 %7B%0A  var 
-spawn
+execFile
  = requi
@@ -147,17 +147,50 @@
 s').
-spawnSync
+execFileSync;%0A  var path = require('path')
 ;%0A%0A 
@@ -244,16 +244,101 @@
 rhel';%0A%0A
+  // Constructor%0A  (function() %7B%0A    path2MozJs = path.resolve(path2MozJs);%0A  %7D)();%0A%0A
   return
@@ -524,13 +524,16 @@
 t = 
-spawn
+execFile
 (pat

Update mozillaParser.js