mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
The handling of hoisted nodes in class bodies was incorrect, as the node was being unwrapped *before* checking if it was hoisted, meaning nodes that should have been hoisted would be output normally. This affected `PassthroughLiteral`s as they were wrapped in a `Value`.
This commit is contained in:
committed by
Geoffrey Booth
parent
22fb31e317
commit
4d4e47bfb2
@@ -701,6 +701,12 @@
|
||||
ref1 = this.expressions;
|
||||
for (index = j = 0, len1 = ref1.length; j < len1; index = ++j) {
|
||||
node = ref1[index];
|
||||
if (node.hoisted) {
|
||||
// This is a hoisted expression.
|
||||
// We want to compile this and ignore the result.
|
||||
node.compileToFragments(o);
|
||||
continue;
|
||||
}
|
||||
node = node.unwrapAll();
|
||||
node = node.unfoldSoak(o) || node;
|
||||
if (node instanceof Block) {
|
||||
@@ -708,10 +714,6 @@
|
||||
// enclose it in a new scope; we just compile the statements in this
|
||||
// block along with our own.
|
||||
compiledNodes.push(node.compileNode(o));
|
||||
} else if (node.hoisted) {
|
||||
// This is a hoisted expression.
|
||||
// We want to compile this and ignore the result.
|
||||
node.compileToFragments(o);
|
||||
} else if (top) {
|
||||
node.front = true;
|
||||
fragments = node.compileToFragments(o);
|
||||
|
||||
Reference in New Issue
Block a user