dholesaurabhm / js-addin

Automatically exported from code.google.com/p/js-addin
0 stars 0 forks source link

Failed parsing JS file with '<script>' in string literals #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Open SharePoint 2010 JsGrid.debug.js (attached)

Error "Unterminated string literal" appeared, but source file is OK

Original issue reported on code.google.com by gandjus...@gmail.com on 3 Apr 2012 at 8:22

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, gandjustas.

Thanks for the interesting issue, indeed, it is 100% reproducible.

The problem is not in large file size, but related to inner functionality for 
analyzing javascript in <script>...</script> blocks for HTML.

so here is your code at line 16959:
newWin.document.writeln( String.format( [
            '<script>',
            'var _spRegionalSettings={0}',
            '</script>'
            ].join('\n'), Sys.Serialization.JavaScriptSerializer.serialize(_spRegionalSettings))
        );

If you replace '<script>' with '<sc'+'ript>' then code analyze will perform 
fine.

Anyway this is a bug, so I am going to fix it in the next version.

Thanks a lot.

Original comment by mega.boich@gmail.com on 4 Apr 2012 at 8:49

GoogleCodeExporter commented 9 years ago

Original comment by mega.boich@gmail.com on 4 Apr 2012 at 8:50