sstephenson/execjs — Issue #72: Trying to use with jshint, won't work - correct usage?
Author: carhartl
Created: 2012-02-15 10:19:47+00:00
State: open

Given the following js file foo.js:

```javascript
var f = function() {
if (false)
alert('foo');
}
```
I am trying to get to JSHINT errors using execjs, irb session:

irb(main):001:0> require 'execjs'
=> true
irb(main):002:0> context = ExecJS.compile(File.read('jshint.js'))
=> #, @source="...">
irb(main):003:0> context.call('JSHINT', File.read('foo.js'))
=> false
irb(main):004:0> context.exec('return JSHINT.errors;')
=> nil
irb(main):005:0>

Linting the file delivers the expected result `false`, but I expected to not get `nil` in the last line, since ultimately what is returned by ` context.call('JSHINT', File.read('foo.js'))` is this:

```javascript
return JSHINT.errors.length === 0;
```

Am I missing something?