File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
2
+ function reportError(message) {
3
+ if (typeof console !== 'undefined'){
4
+ console.error(new Error(errorMessage));
5
+ return;
6
+ }
7
+
8
+ if ($.error) {
9
+ $.error(errorMessage);
10
+ }
11
+ }
12
+
2
13
if ( $.pubsub ){
3
- $.error( 'pubsub is already defined on jQuery, skipping integration of PubSubJS' );
14
+ reportError( 'pubsub is already defined on jQuery, skipping integration of PubSubJS');
4
15
return false;
5
16
}
6
17
7
18
function pubsub( method ){
8
19
if ( PubSub.hasOwnProperty( method ) && typeof PubSub[ method ] === 'function' ){
9
20
return PubSub[ method ].apply( self, Array.prototype.slice.call( arguments, 1 ) );
10
- } else {
11
- $.error( 'Method ' + method + ' does not exist on jQuery.pubsub' );
12
21
}
22
+
23
+ reportError('Method ' + method + ' does not exist on jQuery.pubsub');
13
24
}
14
25
15
26
// export into jQuery
You can’t perform that action at this time.
0 commit comments