mirror of
https://github.com/samsonjs/batteries.git
synced 2026-03-25 09:15:46 +00:00
nuke node <0.4 constants hack
This commit is contained in:
parent
0fcb346d24
commit
34a5d9455e
1 changed files with 2 additions and 10 deletions
|
|
@ -2,17 +2,9 @@ var fs = require('fs')
|
|||
, ArrayExt = require('./array-ext').ArrayExt
|
||||
, LineEmitter = require('./line-emitter').LineEmitter
|
||||
, ext = require('./ext')
|
||||
, constants
|
||||
, ENOENT
|
||||
, constants = require('constants')
|
||||
;
|
||||
|
||||
try {
|
||||
constants = require('constants')
|
||||
} catch (e) {
|
||||
constants = process
|
||||
}
|
||||
ENOENT = constants.ENOENT
|
||||
|
||||
exports.extend = function(obj) {
|
||||
ext.extend(obj || fs, FileExt);
|
||||
}
|
||||
|
|
@ -41,7 +33,7 @@ var FileExt = exports.FileExt = {
|
|||
fs.statSync(f)
|
||||
return true
|
||||
} catch (e) {
|
||||
if (e.errno === ENOENT) return false
|
||||
if (e.errno === constants.ENOENT) return false
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue