Just a quick tip in case you're trying to debug PhoneGap with weinre: you'll need to strip out your "use strict" statements otherwise you'll get this:
Uncaught TypeError: Illegal access to a strict mode caller function.
Yup, Weinre doesn't support strict mode.
Me, I strip 'em out prior to a debug session with Weinre. Otherwise they're left in.
The only thing you'll need to be careful about is the behaviour of
eval and the
arguments; see the MDN's excellent page on this