uxsolutions / bootstrap-datepicker

A datepicker for twitter bootstrap (@twbs)
Apache License 2.0
12.68k stars 6.06k forks source link

bootstrap-datepicker contains a redefinition of undefined #2663

Open redking00 opened 2 years ago

redking00 commented 2 years ago

Current release contains a redefinition of "undefined". This redefinition is detected by the "Special identifiers should not be bound or assigned" Sonar rule. According to the rule:

JavaScript has special identifiers that, while not reserved, still should not be used as identifiers. They include:

eval - evaluates a string as JavaScript code
arguments - used to access function arguments through indexed properties.
undefined - returned for values and properties that have not yet been assigned
NaN - Not a Number; returned when math functions fail.
Infinity - when a number exceeds the upper limit of the floating point numbers

These words should not be bound or assigned, because doing so would overwrite the original definitions of these identifiers. What’s more, assigning or binding some of these names will generate an error in JavaScript strict mode code.

May be this is not a real issue but would be great if the alert could be avoided.

Thanks.

trysten commented 9 months ago

Can you give more details? Like where it's redefined etc