Permalink
Browse files

Adapt to newer nodejs versions (runInThisContext)

  • Loading branch information...
1 parent 4a6e1fc commit b88b238ffb575a6d7406389ffb622c3a8e9bf0de @davidaurelio davidaurelio committed Dec 28, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/adapters/node.js
View
5 src/adapters/node.js
@@ -26,7 +26,10 @@ foounit.generateSuite = require('./node/cli').generateSuite;
var adapter = (function (){
var sys = require('sys')
, fs = require('fs')
- , runInThisContext = process.binding('evals').Script.runInThisContext;
+ , runInThisContext = (
+ process.binding('evals').Script || // older node versions
+ require('vm') // newer node versions
+ ).runInThisContext;
// Private variables
var self = {}, _specdir;

0 comments on commit b88b238

Please sign in to comment.