function wrapCallbackFnToAsyncFn(fn) {
  return function (gl, arg1) {
    for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
      args[_key2 - 2] = arguments[_key2];
    }
    return new Promise(function (resolve, reject) {
      var programOptions = getProgramOptions.apply(void 0, args);
      programOptions.callback = function (err, program) {
        if (err) {
          reject(err);
        } else {
          resolve(program);
        }
      };
      fn(gl, arg1, programOptions);
    });
  };
}
This only works because the functions it wraps the first 2 arguments
are gl and any, followed by things that become programOptions
@private