mirror of
https://github.com/slap-editor/slap.git
synced 2024-09-11 12:58:30 +03:00
Fixing ReferenceError with Promise when running slap on Node 0.10
This commit is contained in:
parent
dff57b856c
commit
3ebc25f692
11
lib/cli.js
11
lib/cli.js
@ -59,7 +59,16 @@ if (opts.perf.profile && process.execArgv.indexOf('--prof') === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var Promise = require('bluebird');
|
||||
try {
|
||||
var Promise = require('bluebird');
|
||||
} catch (e) {
|
||||
if (e instanceof ReferenceError) {
|
||||
global.Promise = require('bluebird');
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
var fs = Promise.promisifyAll(require('fs'));
|
||||
|
||||
var blessed = require('base-widget').blessed;
|
||||
|
Loading…
Reference in New Issue
Block a user