space_function option to always include a space after function keyword

This commit is contained in:
Ates Goral 2014-10-12 01:02:29 -04:00
parent a64bdda9ae
commit c1ae2dae87

View File

@ -50,6 +50,7 @@ function OutputStream(options) {
indent_level : 4, indent_level : 4,
quote_keys : false, quote_keys : false,
space_colon : true, space_colon : true,
space_function : false,
ascii_only : false, ascii_only : false,
unescape_regexps : false, unescape_regexps : false,
inline_script : false, inline_script : false,
@ -713,8 +714,10 @@ function OutputStream(options) {
if (!nokeyword) { if (!nokeyword) {
output.print("function"); output.print("function");
} }
if (self.name) { if (options.space_function || self.name) {
output.space(); output.space();
}
if (self.name) {
self.name.print(output); self.name.print(output);
} }
output.with_parens(function(){ output.with_parens(function(){