From ef186936208ae4b14fa28f902e5a9a5fc3b0b160 Mon Sep 17 00:00:00 2001 From: Sema Date: Wed, 16 Aug 2023 23:53:10 -0400 Subject: [PATCH] Fixed _M2 --- javascript/JZZ.js | 3 +++ test/common.js | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/javascript/JZZ.js b/javascript/JZZ.js index 3ffe4d2..634627d 100644 --- a/javascript/JZZ.js +++ b/javascript/JZZ.js @@ -529,6 +529,9 @@ if (!m._stamped(this._outs[i])) this._outs[i].send(m._stamp(this)); } }; + _M2.prototype.connect = _M.prototype.connect; + _M2.prototype.disconnect = _M.prototype.disconnect; + _M2.prototype.connected = _M.prototype.connected; // _W: Watcher object ~ MIDIAccess.onstatechange function _W() { diff --git a/test/common.js b/test/common.js index bdfb1b6..a240ad2 100644 --- a/test/common.js +++ b/test/common.js @@ -1268,13 +1268,12 @@ describe('JZZ.Widget', function() { }); describe('JZZ.Widget2', function() { - it('connect', function(done) { - var port1 = JZZ.Widget2({ _receive: function(msg) { this._emit(msg); done(); }}); + it('noop', function(done) { + var sample = new test.Sample(done, [[0, 0, 0, 0]]); + var port1 = JZZ.Widget2(); var port2 = JZZ.Widget2(); - var port3 = JZZ.Widget2(); - //port1.connect(port2); - //port2.connect(port3); - //port3.connect(port1); + port1.connect(port2); + port2.connect(function(msg) { sample.compare(msg); }); port1.noop(); }); });