Ver código fonte

[eslint] prefer-spread

dev1
Lyubo Marinov 8 anos atrás
pai
commit
4d2a24ba87
4 arquivos alterados com 4 adições e 5 exclusões
  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 Ver arquivo

@@ -52,6 +52,7 @@ module.exports = {
52 52
             { 'nestedBinaryExpressions': false }
53 53
         ],
54 54
 
55
+        'prefer-spread': 2,
55 56
         'require-yield': 2,
56 57
         'rest-spread-spacing': 2,
57 58
         'sort-imports': 0,

+ 1
- 1
JitsiConnection.js Ver arquivo

@@ -70,7 +70,7 @@ JitsiConnection.prototype.disconnect = function () {
70 70
     // provide the implementation with finer-grained context.
71 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 Ver arquivo

@@ -131,7 +131,7 @@ var JitsiMediaDevices = {
131 131
      * @param {string} event - event name
132 132
      */
133 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 Ver arquivo

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

Carregando…
Cancelar
Salvar