|
@@ -37,7 +37,6 @@ var LibJitsiMeet = {
|
37
|
37
|
|
38
|
38
|
version: '{#COMMIT_HASH#}',
|
39
|
39
|
|
40
|
|
- JitsiConnection: JitsiConnection,
|
41
|
40
|
events: {
|
42
|
41
|
conference: JitsiConferenceEvents,
|
43
|
42
|
connection: JitsiConnectionEvents,
|
|
@@ -61,10 +60,10 @@ var LibJitsiMeet = {
|
61
|
60
|
var oldOnErrorHandler = window.onerror;
|
62
|
61
|
window.onerror = function (message, source, lineno, colno, error) {
|
63
|
62
|
|
64
|
|
- JitsiMeetJS.getGlobalOnErrorHandler(
|
|
63
|
+ this.getGlobalOnErrorHandler(
|
65
|
64
|
message, source, lineno, colno, error);
|
66
|
65
|
|
67
|
|
- if(oldOnErrorHandler)
|
|
66
|
+ if (oldOnErrorHandler)
|
68
|
67
|
oldOnErrorHandler(message, source, lineno, colno, error);
|
69
|
68
|
}
|
70
|
69
|
}
|
|
@@ -168,11 +167,12 @@ var LibJitsiMeet = {
|
168
|
167
|
'Line: ' + lineno,
|
169
|
168
|
'Column: ' + colno,
|
170
|
169
|
'StackTrace: ', error);
|
171
|
|
-
|
172
|
|
- JitsiMeetJS._globalOnErrorHandler.forEach(function (handler) {
|
173
|
|
- handler(error);
|
174
|
|
- });
|
175
|
|
- if(!JitsiMeetJS._globalOnErrorHandler.length){
|
|
170
|
+ var globalOnErrorHandler = this._globalOnErrorHandler;
|
|
171
|
+ if (globalOnErrorHandler.length) {
|
|
172
|
+ globalOnErrorHandler.forEach(function (handler) {
|
|
173
|
+ handler(error);
|
|
174
|
+ });
|
|
175
|
+ } else {
|
176
|
176
|
Statistics.sendUnhandledError(error);
|
177
|
177
|
}
|
178
|
178
|
},
|
|
@@ -187,6 +187,15 @@ var LibJitsiMeet = {
|
187
|
187
|
}
|
188
|
188
|
};
|
189
|
189
|
|
|
190
|
+// XXX JitsiConnection or the instances it initializes and is associated with
|
|
191
|
+// (e.g. JitsiConference) may need a reference to LibJitsiMeet (aka
|
|
192
|
+// JitsiMeetJS). An approach could be to declare LibJitsiMeet global (which is
|
|
193
|
+// what we do in Jitsi Meet) but that could be seen as not such a cool decision
|
|
194
|
+// certainly looks even worse within the lib-jitsi-meet library itself. That's
|
|
195
|
+// why the decision is to provide LibJitsiMeet as a parameter of
|
|
196
|
+// JitsiConnection.
|
|
197
|
+LibJitsiMeet.JitsiConnection = JitsiConnection.bind(null, LibJitsiMeet);
|
|
198
|
+
|
190
|
199
|
//Setups the promise object.
|
191
|
200
|
window.Promise = window.Promise || require("es6-promise").Promise;
|
192
|
201
|
|