Browse Source

[eslint] prefer-spread

dev1
Lyubo Marinov 8 years ago
parent
commit
4d2a24ba87
4 changed files with 4 additions and 5 deletions
  1. 1
    0
      .eslintrc.js
  2. 1
    1
      JitsiConnection.js
  3. 1
    1
      JitsiMediaDevices.js
  4. 1
    3
      modules/RTC/RTCUtils.js

+ 1
- 0
.eslintrc.js View File

52
             { 'nestedBinaryExpressions': false }
52
             { 'nestedBinaryExpressions': false }
53
         ],
53
         ],
54
 
54
 
55
+        'prefer-spread': 2,
55
         'require-yield': 2,
56
         'require-yield': 2,
56
         'rest-spread-spacing': 2,
57
         'rest-spread-spacing': 2,
57
         'sort-imports': 0,
58
         'sort-imports': 0,

+ 1
- 1
JitsiConnection.js View File

70
     // provide the implementation with finer-grained context.
70
     // provide the implementation with finer-grained context.
71
     var x = this.xmpp;
71
     var x = this.xmpp;
72
 
72
 
73
-    x.disconnect.apply(x, arguments);
73
+    x.disconnect(...arguments);
74
 };
74
 };
75
 
75
 
76
 /**
76
 /**

+ 1
- 1
JitsiMediaDevices.js View File

131
      * @param {string} event - event name
131
      * @param {string} event - event name
132
      */
132
      */
133
     emitEvent: function (event) { // eslint-disable-line no-unused-vars
133
     emitEvent: function (event) { // eslint-disable-line no-unused-vars
134
-        eventEmitter.emit.apply(eventEmitter, arguments);
134
+        eventEmitter.emit(...arguments);
135
     }
135
     }
136
 };
136
 };
137
 
137
 

+ 1
- 3
modules/RTC/RTCUtils.js View File

450
  * @param {Array} [args=[]] arguments for function
450
  * @param {Array} [args=[]] arguments for function
451
  */
451
  */
452
 function maybeApply(fn, args) {
452
 function maybeApply(fn, args) {
453
-  if (fn) {
454
-    fn.apply(null, args || []);
455
-  }
453
+  fn && fn(...args);
456
 }
454
 }
457
 
455
 
458
 var getUserMediaStatus = {
456
 var getUserMediaStatus = {

Loading…
Cancel
Save