process.evalcx has a deprecation message.
authorHerbert Vojčík <herby@mailbox.sk>
Wed, 28 Apr 2010 20:51:16 +0000 (22:51 +0200)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 28 Apr 2010 21:40:11 +0000 (14:40 -0700)
src/node.js

index d745588..ef3441e 100644 (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()