googlearchive / paper-slider

A slider à la Material Design
16 stars 18 forks source link

Adds a missing "var" keyword to updateMarkers #32

Closed 0x24a537r9 closed 9 years ago

0x24a537r9 commented 9 years ago

The author forgot "var", so the "l" var is declared on the global scope. Apart from being wrong, it's dangerous for anyone using compiled/obfuscated JS, where it may be overwriting an obfuscated variable (common because it's only a single letter). I came across the bug when I noticed it overwriting what was supposed to be an alias for the window object in my compiled code.

Simply adding a var keyword redeclares it in the local scope, fixing the problem.

frankiefu commented 9 years ago

Before this PR can be merged, please sign the CLA. See the CONTRIBUTING guide.

0x24a537r9 commented 9 years ago

Done: "Thanks, your CLA has been submitted."

Do I need to do anything else (e.g. add myself to that CONTRIBUTING file)?

frankiefu commented 9 years ago

lgtm