Some hacks to support JSON minimisation.
UglifyJS doesn't generate valid JSON by default; implemented a workaround where we first convert the AST into a plain object, and then use JSON.stringify.
Negative numbers need special treatment in toJSON conversion.
don't simplify regexps in JSON mode; temporary hack
edit comment