mozilla/narcissus — pull request #48 by sgentle (2012-01-11 02:58:04+00:00)
Title: Making interpreter work in nodejs

Hi,

Not sure if this is useful to you or not, but I noticed narcissus has an NPM package that doesn't include the interpreter. I added it to the list of exported modules, and then fixed errors in jsexec and jsresolve by replacing ```let```s with ```var```s and factoring ```catch e if``` into separate ```catch``` and ```if``` blocks with rethrows.

Node (at least, the version I'm using) doesn't support harmony proxies yet, but there's an npm module called node-proxy that implements them, so I added that to the package dependencies.

I'm a little confused about tests, though. ```jstests``` needs a jstests.py which I don't have, and presumably a directory of tests that I also don't have. Should I look somewhere for them?

I get the same pattern of successes and failures from the harmony tests, and my ghetto testing looks promising:

```
> require('./main.js').interpreter.evaluate("2+2");
4
```