jamietre / SharpLinter

Linting tools for Visual Studio & C#
http://blog.outsharked.com/2011/08/sharplinter-command-line-tool-for.html
44 stars 12 forks source link

Process is terminated due to StackOverflowException #3

Closed jackrh closed 12 years ago

jackrh commented 12 years ago

Installed sharplinter and was able to get it working easily enough but I wanted to replace jshint with the latest jslint. Grabbed the jslint marked 2012-04-15 but that causes sharplinter to crash with the above error.

jamietre commented 12 years ago

The output from JSLINT returns a self-referencing data structure. This causes the Neosis Javascript wrapper to fail when mapping the data for output to C#. You can confirm this by trying to convert the data to JSON from something that causes Sharplinter to crash, e.g. here's a quick and dirty frontend for JSLINT that tries to convert the output. (Will only work in chrome).

http://jsfiddle.net/StNMy/

This seems like a JSLINT bug to me, at least I can't think of a good reason to create circular data structures for reporting errors. Anyway I was able to work around it by removing "functions" from the object that jslint returns (which sharplinter doesn't use anyway). Latest version resolves it.

jamietre commented 12 years ago

Reference from jslint:

https://github.com/douglascrockford/JSLint/issues/22

Crockford does not regard this as a bug despite the fact that no JSON serializer can handle the output. I'd recommend using JSHINT anyway but the workaround I used should be fine for now.

jackrh commented 12 years ago

That worked, thanks for the fix and the project!