Loading ...
Sorry, an error occurred while loading the content.

Re: SV: [jslint] Re: ANN: JSLint Reporter (Node.js wrapper)

Expand Messages
  • Frederik Dohr
    ... I agree that this would be the ideal solution - and looking at your LintServer*, it appears you ve already solved this issue (I must have misunderstood you
    Message 1 of 11 , Feb 2, 2011
    View Source
    • 0 Attachment
      > Node.js has a built-in feature for running scripts “sandboxed” [...]
      > The Node.js feature I mentioned is in the VM module. [...] If you use
      > those features (and use them correctly, which is not trivial), it
      > becomes completely safe to download and run any script

      I agree that this would be the ideal solution - and looking at your
      LintServer*, it appears you've already solved this issue (I must have
      misunderstood you before):
      vm.runInNewContext(fs.readFileSync('./fulljslint.js', 'utf8'),
      sandbox, 'fulljslint.js');

      This appears to work just fine:
      https://gist.github.com/809174
      (untrusted.js throws exceptions since it doesn't have access to require)

      It should be rather straightforward to add this to JSLint Reporter then.


      -- F.


      * https://github.com/jkruse/LintServer/blob/master/lintserver.js
    Your message has been successfully submitted and would be delivered to recipients shortly.