Make the javascript module API nodey.

Add a createScript function, and put stuff on exports instead of hiding
it in exports.Script.
This commit is contained in:
isaacs 2010-11-15 00:40:38 -08:00 committed by Ryan Dahl
parent 6b71e0b038
commit d39d3cec65

View File

@ -1,3 +1,11 @@
var binding = process.binding('evals');
exports.Script = binding.Script;
exports.createScript = function (code, ctx, name) {
return new exports.Script(code, ctx, name);
};
exports.createContext = binding.Script.createContext;
exports.runInContext = binding.Script.runInContext;
exports.runInThisContext = binding.Script.runInThisContext;
exports.runInNewContext = binding.Script.runInNewContext;