pickadate.js icon indicating copy to clipboard operation
pickadate.js copied to clipboard

pickadate.js does not support strict mode

Open aleksanderzubkov opened this issue 10 years ago • 5 comments

pickadate.js has problems with minificators because of undefined variable namesCount assignment:

https://github.com/amsul/pickadate.js/blob/master/lib/picker.js#L540

for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {

should be

for ( i = 0; i < names.length; i++ ) {

aleksanderzubkov avatar Sep 10 '15 18:09 aleksanderzubkov

@DanielRuf seems like a simple fix to just add namesCount to the var declared above :)

amsul avatar Apr 02 '19 22:04 amsul

Theoretically i and namesCount should both use var (in the head of the loop).

DanielRuf avatar Apr 03 '19 04:04 DanielRuf

i is already there though. So namesCount is the only problem as it is

amsul avatar Apr 03 '19 17:04 amsul

Sure but it is normally better to move them into the head of the loop (imo).

DanielRuf avatar Apr 03 '19 17:04 DanielRuf

@DanielRuf true..it's just super old code. Feel free to fix it as you see fit.

amsul avatar Apr 03 '19 17:04 amsul