Interpreting JavaScript outside of the browser?

前端 未结 6 428
慢半拍i
慢半拍i 2020-12-28 18:21

This is more out of curiosity that a real requirement, but I\'m wondering if it\'s possible to treat JavaScript as (ideally) a first-class .NET citizen, or (secondarily) hav

相关标签:
6条回答
  • 2020-12-28 18:35

    According to this page, there used to be 2 "implementations" on the CLR:

    http://blogs.ugidotnet.org/nettools/articles/8060.aspx

    But both seem to be dead...

    0 讨论(0)
  • 2020-12-28 18:48

    It's perfectly possible to run JavaScript applications without the use of a web browser. You can do this just by running the application using cscript (typically javascript files end with .js).

    0 讨论(0)
  • 2020-12-28 18:52

    For your second option, there's Rhino and things like it.

    0 讨论(0)
  • 2020-12-28 18:56

    You can also run .js files with node.js. Hope this helps someone else.

    0 讨论(0)
  • 2020-12-28 18:57

    Using the DLR (Dynamic Language Runtime) you can use Managed JScript. See the official JScript blog from Microsoft here.

    http://blogs.msdn.com/jscript/archive/2007/05/04/managed-jscript-announced.aspx

    This is goes for Ruby (IronRuby), Python (IronPython), and Dynamic VB. You can also write your own DLR language.

    0 讨论(0)
  • 2020-12-28 18:59

    JScript is available on .NET as a first-class citizen. It's not exactly JavaScript, but it may be close enough for your needs.

    0 讨论(0)
提交回复
热议问题