admin管理员组文章数量:1315952
Is there a way to tell CoffeeScript to just ignore a certain line and output it as is?
I want this line to be included in the resulting javascript
#import './blah/blah'
But CoffeeScript is piling it as a ment so it ends up as
//import './blah/blah'
I need it to not do that because the script is being used for Apple's UIAutomation Instrument to drive iPhone UI. UIAutomation recognizes special #import statements but not if they are getting turned into javascript ments.
Is there a way to tell CoffeeScript to just ignore a certain line and output it as is?
I want this line to be included in the resulting javascript
#import './blah/blah'
But CoffeeScript is piling it as a ment so it ends up as
//import './blah/blah'
I need it to not do that because the script is being used for Apple's UIAutomation Instrument to drive iPhone UI. UIAutomation recognizes special #import statements but not if they are getting turned into javascript ments.
Share Improve this question edited Apr 12, 2012 at 19:36 Jacob Schoen 14.2k15 gold badges86 silver badges107 bronze badges asked Feb 20, 2012 at 8:16 Christian SchlenskerChristian Schlensker 22.5k20 gold badges78 silver badges122 bronze badges2 Answers
Reset to default 9Enclose the statement with backicks (`)
`#import './blah/blah'`
You can use any JavaScript code that way.
Doh, found the answer in the coffeescript docs
hi = `function() {
return [document.title, "Hello JavaScript"].join(": ");
}`
本文标签: Have CoffeeScript output a line as raw javascriptStack Overflow
版权声明:本文标题:Have CoffeeScript output a line as raw javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741996638a2410176.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论