process.evalcx has a deprecation message.

This commit is contained in:
Herbert Vojčík authored and Ryan Dahl committed 2010-04-28 14:40:11 -07:00
1 parent 7e4c1285dc
commit 7a72885ede
1 file changed
+9 -1
+9 -1
View File
@@ -29,7 +29,15 @@ process.assert = function (x, msg) {
if (!x) throw new Error(msg || "assertion error");
};
process.evalcx = process.binding('evals').Script.runInNewContext;
var evalcxMsg;
process.evalcx = function () {
if (!evalcxMsg) {
process.binding('stdio').writeError(evalcxMsg =
"process.evalcx is deprecated. Use Script.runInNewContext instead.\n");
}
return process.binding('evals').Script
.runInNewContext.apply(null, arguments);
};
// nextTick()