Changes between Initial Version and Version 2 of Ticket #15192


Ignore:
Timestamp:
May 26, 2017, 6:29:28 PM (2 years ago)
Author:
Ryan J Ollos
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15192 – Description

    initial v2  
    1 I am wondering why you are excluding '===' and '!==' validation from jshint.
     1I am wondering why you are excluding `===` and `!==` validation from jshint.
    22
    33When I am evaluating code by using jshint I am getting many warning:
    44
    5 Expected '!==' and instead saw '!='.
     5Expected `!==` and instead saw `!=`.
    66
    77One of critical issue in your core widget on line 35
     
    1111You are implemented for loop such as:
    1212
     13{{{#!javascript
    1314for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
     15}}}
    1416
    15 however "( elem = elems[ i ] )" will never will be null i most cases is "undefined"
     17however `( elem = elems[ i ] )` will never will be null i most cases is "undefined"
    1618
    1719If I will change to strong type such as:
    1820
     21{{{#!javascript
    1922for ( i = 0; ( elem = elems[ i ] ) !== null; i++ ) {
     23}}}
    2024
    2125I will be in infinite loop and browser will be freezes.
     
    2428I will suggest make changes and fix this loops as well either:
    2529
     30{{{#!javascript
    2631for ( i = 0; ( elem = elems[ i ] ) !== undefined; i++ )
     32}}}
    2733or
     34{{{#!javascript
    2835for ( i = 0; !!( elem = elems[ i ] ); i++ )
     36}}}
    2937
    3038to handle null and undefined