Merge pull request #1 from joedakroub/jd/gun-mesh-this-error-esm-fix

Test fix - Loading gun via ES Modules throws error when setting a peer
This commit is contained in:
Joe Dakroub 2020-04-10 11:03:25 -04:00 committed by GitHub
commit 1a71145b4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
gun.js
View File

@ -2148,7 +2148,7 @@
var message, loop;
function each(peer){ mesh.say(message, peer) }
var say = mesh.say = function(msg, peer){
if(this.to){ this.to.next(msg) } // compatible with middleware adapters.
if(this && this.to){ this.to.next(msg) } // compatible with middleware adapters.
if(!msg){ return false }
var id, hash, tmp, raw;
var DBG = msg.DBG, S; if(!peer){ S = +new Date ; DBG && (DBG.y = S) }