Fix DeprecationWarning for node 7.x
This commit is contained in:
parent
d2cbcecf2a
commit
220473102e
|
@ -289,7 +289,10 @@ See [bench/README](bench).
|
|||
|
||||
## Changes
|
||||
|
||||
1.1 -
|
||||
1.1.1
|
||||
- Fix DeprecationWarning for node 7.x
|
||||
|
||||
1.1.0
|
||||
- added seek() method
|
||||
- added lexName property
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"verbs"
|
||||
],
|
||||
"description": "wordpos is a set of part-of-speech utilities for Node.js using the WordNet database.",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"homepage": "https://github.com/moos/wordpos",
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
|
|
|
@ -178,7 +178,7 @@ function lookup(offsets, callback) {
|
|||
function closeFile() {
|
||||
if (--self.refcount === 0) {
|
||||
//console.log(' ... closing', self.filePath);
|
||||
fs.close(self.fd);
|
||||
fs.closeSync(self.fd);
|
||||
self.fd = null;
|
||||
}
|
||||
return Promise.resolve();
|
||||
|
|
|
@ -72,7 +72,7 @@ piper.wrapper = function(self, task /*, result...*/){
|
|||
|
||||
if (--self.refcount === 0) {
|
||||
//console.log(' ... closing', self.filePath);
|
||||
fs.close(self.fd);
|
||||
fs.closeSync(self.fd);
|
||||
self.fd = null;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -366,7 +366,7 @@ describe('seek()...', function() {
|
|||
assert(err instanceof Error);
|
||||
assert.equal(err.message, 'offset must be valid positive number.');
|
||||
done();
|
||||
});
|
||||
}).catch(_.noop); // UnhandledPromiseRejectionWarning
|
||||
});
|
||||
|
||||
it('should handle wrong offset', function(done) {
|
||||
|
@ -376,7 +376,7 @@ describe('seek()...', function() {
|
|||
assert.equal(err.message, 'Bad data at location ' + bad_offset);
|
||||
assert.deepEqual(result, {});
|
||||
done();
|
||||
});
|
||||
}).catch(_.noop); // UnhandledPromiseRejectionWarning;
|
||||
});
|
||||
|
||||
it('should handle very large offset', function(done) {
|
||||
|
@ -386,7 +386,7 @@ describe('seek()...', function() {
|
|||
assert.equal(err.message, 'no data at offset ' + bad_offset);
|
||||
assert.deepEqual(result, {});
|
||||
done();
|
||||
});
|
||||
}).catch(_.noop); // UnhandledPromiseRejectionWarning;
|
||||
});
|
||||
|
||||
it('should handle bad pos', function(done) {
|
||||
|
@ -394,13 +394,13 @@ describe('seek()...', function() {
|
|||
assert(err instanceof Error);
|
||||
assert(/Incorrect POS/.test(err.message));
|
||||
done();
|
||||
});
|
||||
}).catch(_.noop); // UnhandledPromiseRejectionWarning;
|
||||
});
|
||||
|
||||
it('should handle wrong pos', function(done) {
|
||||
wordpos.seek(offset, 'v', function(err, result){
|
||||
assert.equal(err.message, 'Bad data at location ' + offset);
|
||||
});
|
||||
}).catch(_.noop); // UnhandledPromiseRejectionWarning;
|
||||
done();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue