(that, data, errorCallback)
| 1413 | }; |
| 1414 | |
| 1415 | function publishCore(that, data, errorCallback) { |
| 1416 | var subscribers = that._subscribers; |
| 1417 | if (!subscribers) return true; |
| 1418 | // subscribers from outer scope. |
| 1419 | subscribers.forEach(function (s) { |
| 1420 | try { |
| 1421 | s.callback(data); |
| 1422 | } catch (e) { |
| 1423 | e.context = "unable to publish on topic: " + that.name; |
| 1424 | if (errorCallback) { |
| 1425 | errorCallback(e); |
| 1426 | } else if (that._defaultErrorCallback) { |
| 1427 | that._defaultErrorCallback(e); |
| 1428 | } else { |
| 1429 | fallbackErrorHandler(e); |
| 1430 | } |
| 1431 | } |
| 1432 | }); |
| 1433 | } |
| 1434 | |
| 1435 | /** |
| 1436 | Publish data for this event asynchronously. |
no test coverage detected