docs: function encode(input, options)
      {
          input = esToString(input);
          options = options || { };
          var features = options.features;
          var runAsData;
          var runAs = options.runAs;
          if (runAs !== undefined)
              runAsData = filterRunAs(runAs, 'runAs');
          else
              runAsData = filterRunAs(options.wrapWith, 'wrapWith');
          var wrapper = runAsData[0];
          var strategyNames = runAsData[1];
          if (options.trimCode)
              input = trimJS(input);
          var perfInfo = options.perfInfo;
          var encoder = getEncoder(features);
          var output = encoder.exec(input, wrapper, strategyNames, perfInfo);
          return output;
      }