mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
removing the CoffeeScript.run named function from eval'd script scope by making it anonymous
This commit is contained in:
parent
69911209ea
commit
4ebaa82563
2 changed files with 4 additions and 3 deletions
|
@ -51,12 +51,12 @@
|
|||
};
|
||||
// Compile and execute a string of CoffeeScript (on the server), correctly
|
||||
// setting `__filename`, `__dirname`, and relative `require()`.
|
||||
exports.run = function run(code, options) {
|
||||
exports.run = (function(code, options) {
|
||||
var __dirname, __filename;
|
||||
module.filename = (__filename = options.source);
|
||||
__dirname = path.dirname(__filename);
|
||||
return eval(exports.compile(code, options));
|
||||
};
|
||||
});
|
||||
// Extend CoffeeScript with a custom language extension. It should hook in to
|
||||
// the **Lexer** (as a peer of any of the lexer's tokenizing methods), and
|
||||
// push a token on to the stack that contains a **Node** as the value (as a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue