Browse Source

[eslint] radix

dev1
Lyubo Marinov 8 years ago
parent
commit
b713d6eb74

+ 1
- 0
.eslintrc.js View File

@@ -131,6 +131,7 @@ module.exports = {
131 131
         'no-void': 2,
132 132
         'no-warning-comments': 0,
133 133
         'no-with': 2,
134
+        'radix': 2,
134 135
         'vars-on-top': 2,
135 136
         'wrap-iife': [ 'error', 'inside' ],
136 137
         'yoda': 2,

+ 1
- 1
JitsiConference.js View File

@@ -812,7 +812,7 @@ JitsiConference.prototype.pinParticipant = function(participantId) {
812 812
  * than -1.
813 813
  */
814 814
 JitsiConference.prototype.setLastN = function(lastN) {
815
-    if (!Number.isInteger(lastN) && !Number.parseInt(lastN)) {
815
+    if (!Number.isInteger(lastN) && !Number.parseInt(lastN, 10)) {
816 816
         throw new Error(`Invalid value for lastN: ${lastN}`);
817 817
     }
818 818
     const n = Number(lastN);

+ 2
- 2
modules/RTC/ScreenObtainer.js View File

@@ -378,10 +378,10 @@ function isUpdateRequired(minVersion, extVersion) {
378 378
                 n2 = 0;
379 379
 
380 380
             if (i < s1.length) {
381
-                n1 = parseInt(s1[i]);
381
+                n1 = parseInt(s1[i], 10);
382 382
             }
383 383
             if (i < s2.length) {
384
-                n2 = parseInt(s2[i]);
384
+                n2 = parseInt(s2[i], 10);
385 385
             }
386 386
 
387 387
             if (isNaN(n1) || isNaN(n2)) {

+ 1
- 1
modules/RTC/TraceablePeerConnection.js View File

@@ -484,7 +484,7 @@ function extractSSRCMap(desc) {
484 484
                     // Parse SSRCs and store as numbers
485 485
                     const groupSSRCs
486 486
                         = group.ssrcs.split(' ')
487
-                                     .map(ssrcStr => parseInt(ssrcStr));
487
+                                     .map(ssrcStr => parseInt(ssrcStr, 10));
488 488
                     const primarySSRC = groupSSRCs[0];
489 489
 
490 490
                     // Note that group.semantics is already present

+ 1
- 1
modules/xmpp/RtxModifier.spec.js View File

@@ -29,7 +29,7 @@ function getPrimaryVideoSsrc(parsedSdp) {
29 29
     const videoMLine = parsedSdp.media.find(m => m.type === 'video');
30 30
 
31 31
 
32
-    return parseInt(SDPUtil.parsePrimaryVideoSsrc(videoMLine));
32
+    return parseInt(SDPUtil.parsePrimaryVideoSsrc(videoMLine), 10);
33 33
 }
34 34
 
35 35
 /**

+ 2
- 2
modules/xmpp/SDPUtil.js View File

@@ -532,7 +532,7 @@ const SDPUtil = {
532 532
         return ssrcGroup
533 533
             .ssrcs
534 534
             .split(' ')
535
-            .map(ssrcStr => parseInt(ssrcStr));
535
+            .map(ssrcStr => parseInt(ssrcStr, 10));
536 536
     },
537 537
 
538 538
     /**
@@ -569,7 +569,7 @@ const SDPUtil = {
569 569
         }
570 570
         if (payloadType) {
571 571
             const payloadTypes
572
-                = videoMLine.payloads.split(' ').map(p => parseInt(p));
572
+                = videoMLine.payloads.split(' ').map(p => parseInt(p, 10));
573 573
             const payloadIndex = payloadTypes.indexOf(payloadType);
574 574
 
575 575
             payloadTypes.splice(payloadIndex, 1);

+ 2
- 1
modules/xmpp/SDPUtil.spec.js View File

@@ -16,7 +16,8 @@ describe('SDPUtil', () => {
16 16
 
17 17
             SDPUtil.preferVideoCodec(videoMLine, 'H264');
18 18
             const newPayloadTypesOrder
19
-                = videoMLine.payloads.split(' ').map(ptStr => parseInt(ptStr));
19
+                = videoMLine.payloads.split(' ').map(
20
+                    ptStr => parseInt(ptStr, 10));
20 21
 
21 22
             expect(newPayloadTypesOrder[0]).toEqual(126);
22 23
         });

+ 2
- 2
modules/xmpp/SdpTransformUtil.js View File

@@ -6,7 +6,7 @@ import * as transform from 'sdp-transform';
6 6
  * @return {Number} the primary SSRC number
7 7
  */
8 8
 export function parsePrimarySSRC(group) {
9
-    return parseInt(group.ssrcs.split(' ')[0]);
9
+    return parseInt(group.ssrcs.split(' ')[0], 10);
10 10
 }
11 11
 
12 12
 /**
@@ -15,7 +15,7 @@ export function parsePrimarySSRC(group) {
15 15
  * @return {Number} the secondary SSRC number
16 16
  */
17 17
 export function parseSecondarySSRC(group) {
18
-    return parseInt(group.ssrcs.split(' ')[1]);
18
+    return parseInt(group.ssrcs.split(' ')[1], 10);
19 19
 }
20 20
 
21 21
 /**

+ 2
- 3
modules/xmpp/strophe.util.js View File

@@ -73,9 +73,8 @@ export default function() {
73 73
             const errStatusCapture = lastErrorStatusRegExpr.exec(msg);
74 74
 
75 75
             if (errStatusCapture && errStatusCapture.length === 2) {
76
-                lastErrorStatus = parseInt(errStatusCapture[1]);
77
-                logger.debug(
78
-                        `lastErrorStatus set to: ${lastErrorStatus}`);
76
+                lastErrorStatus = parseInt(errStatusCapture[1], 10);
77
+                logger.debug(`lastErrorStatus set to: ${lastErrorStatus}`);
79 78
             }
80 79
             break;
81 80
         case Strophe.LogLevel.ERROR:

Loading…
Cancel
Save