lib/qx/tool/compiler/util.js
function promisifyThis(fn, self, ...args) {
  return new Promise((resolve, reject) => {
    args = args.slice();
    args.push(function(err, result) {
      if (err) {
        reject(err); 
      } else {
        resolve(result); 
      }
    });
    try {
      fn.apply(self, args);
    } catch (ex) {
      reject(ex);
    }
  });
}
function promisifyThis(fn, self, ...args) {
  return new Promise((resolve, reject) => {
    args = args.slice();
    args.push(function(err, result) {
      if (err) {
        reject(err); 
      } else {
        resolve(result); 
      }
    });
    try {
      fn.apply(self, args);
    } catch (ex) {
      reject(ex);
    }
  });
}
function promisifyThis ( fn , self , ... args ) { return new Promise ( ( resolve , reject ) => { args = args . slice ( ) ; args . push ( function ( err , result ) { if ( err ) { reject ( err ) ; } else { resolve ( result ) ; } } ) ; try { fn . apply ( self , args ) ; } catch ( ex ) { reject ( ex ) ; } } ) ; }
/*
function promisify(fn, ...args) {
return new Promise((resolve, reject) => {
args = args.slice();
args.push(function(err, result) {
if (err)
reject(err);
else
resolve(result);
});
try {
fn.apply(null, args);
} catch(ex) {
reject(ex);
}
});
}
module.exports.promisify = promisify;
/ * function promisify ( fn ... args ) { return new Promise (( resolve reject ) = > { args = args . slice () ; args . push ( function ( err result ) { if ( err ) reject ( err ) ; else resolve ( result ) ; } ) ; try { fn . apply ( null args ) ; } catch ( ex ) { reject ( ex ) ; } } ) ; } module . exports . promisify = promisify ;