Is it possible to programatically catch JavaScript SyntaxErrors?

前端 未结 3 1054
囚心锁ツ
囚心锁ツ 2021-01-16 04:11

I don\'t think that this is doable, but wanted to throw it out to the community to confirm my suspicions.

Let\'s say you\'re writing a program in another language

3条回答
  •  执笔经年
    2021-01-16 05:01

    Google has released their Closure toolset which includes a JavaScript compiler and minimizer. I haven't used it personally but have heard a lot of great things. Also, it apparently helps you locate browser compatibility issues.

    I don't think it will help you to perform real-time analysis, but still could be a valuable tool.

提交回复
热议问题