How can I compile CoffeeScript from .NET?

后端 未结 18 2002
后悔当初
后悔当初 2020-12-23 01:54

I want to write an HttpHandler that compiles CoffeeScript code on-the-fly and sends the resulting JavaScript code. I have tried MS [JScript][1] and IronJS without success. I

18条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-23 02:36

    I tried running the bundled extras/coffee-script.js through Windows Based Script Host (or just wscript) and it didn't report any issues. I then added this line:

    WScript.Echo(CoffeeScript.compile('a: 1'));
    

    at the end of the file and run it through wscript again and it printed the resulting JavaScript correctly.

    Are you using COM objects? Can you share some more of the code responsible for initialising the MScript object reference?

提交回复
热议问题