mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
don't set options on a callback open function
This commit is contained in:
parent
88bc4c47ce
commit
c796fe7dce
2 changed files with 9 additions and 1 deletions
|
|
@ -77,7 +77,8 @@ function SerialPortFactory() {
|
|||
callback = null;
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
options = (typeof options !== 'function') && options || {};
|
||||
|
||||
openImmediately = (openImmediately === undefined || openImmediately === null) ? true : openImmediately;
|
||||
|
||||
stream.Stream.call(this);
|
||||
|
|
|
|||
|
|
@ -50,6 +50,13 @@ describe('SerialPort', function () {
|
|||
var port = new SerialPort('/dev/exists', { databits : 19 }, false, errorCallback);
|
||||
});
|
||||
|
||||
it('allows optional options', function (done) {
|
||||
var cb = function () {};
|
||||
var port = new SerialPort('/dev/exists', cb);
|
||||
expect(typeof port.options).to.eq('object');
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('reading data', function () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue