noWrap: true -> wrap: false

This commit is contained in:
Sam Stephenson
2010-10-09 15:07:39 -05:00
committed by Jeremy Ashkenas
parent f6ca5d814c
commit 6e6165796c
10 changed files with 434 additions and 478 deletions

View File

@@ -204,12 +204,13 @@
}).call(this).join("\n");
};
Expressions.prototype.compileRoot = function(o) {
var code;
o.indent = (this.tab = o.noWrap ? '' : TAB);
var code, wrap;
wrap = (o.wrap != null) ? o.wrap : true;
o.indent = (this.tab = wrap ? TAB : '');
o.scope = new Scope(null, this, null);
code = this.compileWithDeclarations(o);
code = code.replace(TRAILING_WHITESPACE, '');
return o.noWrap ? code : ("(function() {\n" + code + "\n}).call(this);\n");
return wrap ? ("(function() {\n" + code + "\n}).call(this);\n") : code;
};
Expressions.prototype.compileWithDeclarations = function(o) {
var code;
@@ -1103,7 +1104,7 @@
o.top = true;
o.indent = this.idt(1);
empty = this.body.expressions.length === 0;
del(o, 'noWrap');
del(o, 'wrap');
del(o, 'globals');
splat = undefined;
params = [];