mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
made wrapper function keep current this
This commit is contained in:
@@ -39,4 +39,4 @@
|
||||
attachEvent('onload', processScripts);
|
||||
}
|
||||
}
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -81,4 +81,4 @@
|
||||
puts("No such task: \"" + (task) + "\"");
|
||||
return process.exit(1);
|
||||
};
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -73,4 +73,4 @@
|
||||
}
|
||||
};
|
||||
parser.yy = require('./nodes');
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -245,4 +245,4 @@
|
||||
puts("CoffeeScript version " + (CoffeeScript.VERSION));
|
||||
return process.exit(0);
|
||||
};
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -644,4 +644,4 @@
|
||||
operators: operators.reverse(),
|
||||
startSymbol: 'Root'
|
||||
});
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -96,4 +96,4 @@
|
||||
delete obj[key];
|
||||
return val;
|
||||
});
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
val = _ref[key];
|
||||
(exports[key] = val);
|
||||
}
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -654,4 +654,4 @@
|
||||
'not': '!',
|
||||
'===': '=='
|
||||
};
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
o.scope = new Scope(null, this, null);
|
||||
code = this.compileWithDeclarations(o);
|
||||
code = code.replace(TRAILING_WHITESPACE, '');
|
||||
return o.noWrap ? code : ("(function() {\n" + (code) + "\n})();\n");
|
||||
return o.noWrap ? code : ("(function() {\n" + (code) + "\n}).call(this);\n");
|
||||
};
|
||||
Expressions.prototype.compileWithDeclarations = function(o) {
|
||||
var code;
|
||||
@@ -1971,4 +1971,4 @@
|
||||
Scope.root.assign(ref, UTILITIES[name]);
|
||||
return ref;
|
||||
};
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -112,4 +112,4 @@
|
||||
}
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
});
|
||||
repl.on('line', run);
|
||||
repl.prompt();
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -416,4 +416,4 @@
|
||||
SINGLE_LINERS = ['ELSE', "->", "=>", 'TRY', 'FINALLY', 'THEN'];
|
||||
SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
|
||||
LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -134,4 +134,4 @@
|
||||
};
|
||||
return Scope;
|
||||
}).call(this);
|
||||
})();
|
||||
}).call(this);
|
||||
|
||||
@@ -210,7 +210,7 @@ exports.Expressions = class Expressions extends BaseNode
|
||||
o.scope = new Scope(null, this, null)
|
||||
code = @compileWithDeclarations(o)
|
||||
code = code.replace(TRAILING_WHITESPACE, '')
|
||||
if o.noWrap then code else "(function() {\n#{code}\n})();\n"
|
||||
if o.noWrap then code else "(function() {\n#{code}\n}).call(this);\n"
|
||||
|
||||
# Compile the expressions body for the contents of a function, with
|
||||
# declarations of all inner variables pushed up to the top.
|
||||
|
||||
Reference in New Issue
Block a user