These lines are used to provide get('a','b','c'...) syntax. I test it and it works for me (before your change, with your change it doesn't work).
Can you try to undo your change (these lines and "return ret[a[2]];") and retry to use it to confirm me?

Ex : 
$.localStorage.set('a','b','c',1);
$.localStorage.get('a','b','c'); => return 1