mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 19:34:27 -05:00
adding correct semicolons to bound functions
This commit is contained in:
@@ -999,7 +999,7 @@
|
|||||||
if (!(this.bound)) {
|
if (!(this.bound)) {
|
||||||
return func;
|
return func;
|
||||||
}
|
}
|
||||||
return "(function(_this) {\n" + (this.idt(1)) + "return " + func + "\n" + this.tab + "})(this)";
|
return "(function(_this) {\n" + (this.idt(1)) + "return " + func + ";\n" + this.tab + "})(this)";
|
||||||
};
|
};
|
||||||
CodeNode.prototype.topSensitive = function() {
|
CodeNode.prototype.topSensitive = function() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
};
|
||||||
})(this));
|
})(this));
|
||||||
};
|
};
|
||||||
Rewriter.prototype.removeLeadingNewlines = function() {
|
Rewriter.prototype.removeLeadingNewlines = function() {
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
}
|
}
|
||||||
_this.tokens.splice(i, 1);
|
_this.tokens.splice(i, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
};
|
||||||
})(this));
|
})(this));
|
||||||
};
|
};
|
||||||
Rewriter.prototype.closeOpenCallsAndIndexes = function() {
|
Rewriter.prototype.closeOpenCallsAndIndexes = function() {
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
};
|
||||||
})(this));
|
})(this));
|
||||||
};
|
};
|
||||||
Rewriter.prototype.addImplicitParentheses = function() {
|
Rewriter.prototype.addImplicitParentheses = function() {
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
size = stack[stack.length - 1] + 1;
|
size = stack[stack.length - 1] + 1;
|
||||||
stack[stack.length - 1] = 0;
|
stack[stack.length - 1] = 0;
|
||||||
return size;
|
return size;
|
||||||
}
|
};
|
||||||
})(this);
|
})(this);
|
||||||
return this.scanTokens((function(_this) {
|
return this.scanTokens((function(_this) {
|
||||||
return function(prev, token, post, i) {
|
return function(prev, token, post, i) {
|
||||||
@@ -177,7 +177,7 @@
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
};
|
||||||
})(this));
|
})(this));
|
||||||
};
|
};
|
||||||
Rewriter.prototype.addImplicitIndentation = function() {
|
Rewriter.prototype.addImplicitIndentation = function() {
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
}
|
}
|
||||||
_this.tokens.splice(i, 1);
|
_this.tokens.splice(i, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
};
|
||||||
})(this));
|
})(this));
|
||||||
};
|
};
|
||||||
Rewriter.prototype.ensureBalance = function(pairs) {
|
Rewriter.prototype.ensureBalance = function(pairs) {
|
||||||
@@ -255,7 +255,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
};
|
||||||
})(this));
|
})(this));
|
||||||
unclosed = (function() {
|
unclosed = (function() {
|
||||||
_c = []; _d = levels;
|
_c = []; _d = levels;
|
||||||
@@ -315,7 +315,7 @@
|
|||||||
} else {
|
} else {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
})(this));
|
})(this));
|
||||||
};
|
};
|
||||||
Rewriter.prototype.indentation = function(token) {
|
Rewriter.prototype.indentation = function(token) {
|
||||||
|
|||||||
@@ -892,7 +892,7 @@ exports.CodeNode: class CodeNode extends BaseNode
|
|||||||
func: "function(${ params.join(', ') }) {$code${ code and @idt(if @bound then 1 else 0) }}"
|
func: "function(${ params.join(', ') }) {$code${ code and @idt(if @bound then 1 else 0) }}"
|
||||||
func: "($func)" if top and not @bound
|
func: "($func)" if top and not @bound
|
||||||
return func unless @bound
|
return func unless @bound
|
||||||
"(function(_this) {\n${@idt(1)}return $func\n$@tab})(this)"
|
"(function(_this) {\n${@idt(1)}return $func;\n$@tab})(this)"
|
||||||
|
|
||||||
topSensitive: ->
|
topSensitive: ->
|
||||||
true
|
true
|
||||||
|
|||||||
Reference in New Issue
Block a user