From 0441b83f74ec73d36b4de52a068de76b0727ac7d Mon Sep 17 00:00:00 2001 From: Corentin STG_CADIOU Date: Thu, 21 May 2015 14:24:30 +0200 Subject: [PATCH] Fix error with compute_when_synced --- lib/ConnectorClass.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ConnectorClass.coffee b/lib/ConnectorClass.coffee index 428547a6..575ca121 100644 --- a/lib/ConnectorClass.coffee +++ b/lib/ConnectorClass.coffee @@ -105,7 +105,7 @@ module.exports = # @param f {Function} Will be executed on the PeerJs-Connector context. # whenSynced: (args)-> - if args.constructore is Function + if args.constructor is Function args = [args] if @is_synced args[0].apply this, args[1..] @@ -192,8 +192,10 @@ module.exports = if not @is_synced @is_synced = true if @compute_when_synced? - for f in @compute_when_synced - f() + for el in @compute_when_synced + f = el[0] + args = el[1..] + f.apply(args) delete @compute_when_synced null