如何省略将变量隐藏在全局范围内的自动闭包?
(function() {
// my compiled code
}).call(this);
Run Code Online (Sandbox Code Playgroud)
只是玩弄CoffeeScript + SproutCore,当然,我更愿意保留原样:在这种情况下,没有必要保护任何东西不被覆盖.
我知道我可以使用@或this.在声明,但这不是太优雅.
the*_*ejh 42
快速而肮脏的解决方案:使用控制台标志-b(裸).警告:如果你这样做,小猫就会死!
清洁解决方案:不要这样做.
Usage: coffee [options] path/to/script.coffee
-c, --compile compile to JavaScript and save as .js files
-i, --interactive run an interactive CoffeeScript REPL
-o, --output set the directory for compiled JavaScript
-j, --join concatenate the scripts before compiling
-w, --watch watch scripts for changes, and recompile
-p, --print print the compiled JavaScript to stdout
-l, --lint pipe the compiled JavaScript through JSLint
-s, --stdio listen for and compile scripts over stdio
-e, --eval compile a string from the command line
-r, --require require a library before executing your script
-b, --bare compile without the top-level function wrapper
-t, --tokens print the tokens that the lexer produces
-n, --nodes print the parse tree that Jison produces
--nodejs pass options through to the "node" binary
-v, --version display CoffeeScript version
-h, --help display this help message
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7863 次 |
| 最近记录: |