简体   繁体   English

如何调试Uglify解析错误?

[英]How do I debug Uglify parse errors?

I'm uglifying a JS file and just started getting 我在丑化一个JS文件,然后才开始获取

DEBUG: { message: 'Unexpected token: name (a)',
  line: 1,
  col: 17726,
  pos: 17726

What are the debugging steps I need to follow to track this down? 我需要遵循哪些调试步骤来进行跟踪?

Needless to say, I've tried the obvious stuff like searching for "name" and "(a)", neither of which appear in the file. 不用说,我已经尝试了搜索“名称”和“(a)”之类的显而易见的东西,它们都不出现在文件中。 It would also be helpful to see what "line:1 col: 17726" are referring to since my input file is beautiful JS. 由于我的输入文件是漂亮的JS,因此查看“ line:1 col:17726”的含义也将有所帮助。

Turns out the problem was the final line of one of the files didn't end with a CR. 原来问题是其中一个文件的最后一行没有以CR结尾。 Thus, it and the first line on the following file were being concatenated into a single line. 因此,它和后续文件中的第一行被串联为一行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM