Permalink
Browse files

possible fix for #23, support jshint identifier parser

This fixes #23 for me, however I am not merging this into
master until I see jshint updated again and these new
scripts work.

The longer-term fix for issues like this is to require that
jshint is installed locally as a node module and use it
instead of the jshint we are installing locally in the
bundle.
  • Loading branch information...
1 parent 6e81383 commit 626b66fb31f8ce3ccd8c1f45caf07dc93acd41e0 @stepheneb stepheneb committed Oct 7, 2013
View
@@ -23,9 +23,10 @@ function html(s) {
*/
function download_jshint_resources(ready) {
var req,
- resources = ["jshint.js", "vars.js", "messages.js", "lex.js", "reg.js", "state.js", "style.js"];
+ jshint_resources = ["jshint.js", "vars.js", "messages.js", "lex.js", "reg.js", "state.js", "style.js"],
+ jshint_data_resources = ["ascii-identifier-data.js", "non-ascii-identifier-part-only.js", "non-ascii-identifier-start.js"];
- resources.forEach(function(resource) {
+ jshint_resources.forEach(function(resource) {
req = https.get({host: 'raw.github.com', port: 443, path: '/jshint/jshint/master/src/' + resource}, function(res) {
if (res.statusCode === 200) {
res.setEncoding('utf8');
@@ -44,6 +45,25 @@ function download_jshint_resources(ready) {
ready('Download of ' + resource + ' failed: ' + html(err.message));
});
});
+ jshint_data_resources.forEach(function(resource) {
+ req = https.get({host: 'raw.github.com', port: 443, path: '/jshint/jshint/master/data/' + resource}, function(res) {
+ if (res.statusCode === 200) {
+ res.setEncoding('utf8');
+ var data = '';
+ res.on('data', function(chunk) {
+ data += chunk;
+ });
+ res.on('end', function() {
+ fs.writeFile(__dirname + '/../data/' + resource, data, ready);
+ });
+ }
+ else {
+ ready('Download of ' + resource + ' failed. HTTP status code: ' + res.statusCode);
+ }
+ }).on('error', function(err) {
+ ready('Download of ' + resource + ' failed: ' + html(err.message));
+ });
+ });
}
/**
Oops, something went wrong.

0 comments on commit 626b66f

Please sign in to comment.