getPressedKeys() should return a clone of _downKeys #70

merged 1 commit into from Dec 26, 2012

2 participants


getPressedKeys() right now is returning the actual private _downKeys variable. This exposes internal state and is mutable.

The fix will only return a new Array. The test checks to make sure that the #getPressedKeys returns a new array whenever called.

@madrobby madrobby merged commit 84df69f into madrobby:master Dec 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment