From 44ea97c19c52073d19c3af80db1a354558f6c16a Mon Sep 17 00:00:00 2001 From: Iskren Slavov Date: Sun, 26 Jun 2016 09:24:30 +0300 Subject: [PATCH 1/2] Do not redefine global Promise when it is available --- lib/list-unix.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/list-unix.js b/lib/list-unix.js index af391a3..3e3201d 100644 --- a/lib/list-unix.js +++ b/lib/list-unix.js @@ -1,5 +1,9 @@ 'use strict'; -var Promise = require('es6-promise').Promise; + +var Promise = typeof global.Promise == 'function' + ? global.Promise + : require('es6-promise').Promise; + var childProcess = require('child_process'); var fs = require('fs'); var path = require('path'); From 21ecbf603a3cc20ec109ea103608487319a92c5c Mon Sep 17 00:00:00 2001 From: Iskren Slavov Date: Sun, 26 Jun 2016 10:02:04 +0300 Subject: [PATCH 2/2] Update list-unix.js --- lib/list-unix.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/list-unix.js b/lib/list-unix.js index 3e3201d..29c64df 100644 --- a/lib/list-unix.js +++ b/lib/list-unix.js @@ -1,6 +1,6 @@ 'use strict'; -var Promise = typeof global.Promise == 'function' +var Promise = typeof global.Promise === 'function' ? global.Promise : require('es6-promise').Promise;