Browse Source

Print deprecation warning on process.compile

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
f6479f2fb6
  1. 10
      src/node.cc

10
src/node.cc

@ -1318,14 +1318,24 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
} }
// TODO remove me before 0.4
Handle<Value> Compile(const Arguments& args) { Handle<Value> Compile(const Arguments& args) {
HandleScope scope; HandleScope scope;
if (args.Length() < 2) { if (args.Length() < 2) {
return ThrowException(Exception::TypeError( return ThrowException(Exception::TypeError(
String::New("needs two arguments."))); String::New("needs two arguments.")));
} }
static bool shown_error_message = false;
if (!shown_error_message) {
shown_error_message = true;
fprintf(stderr, "(node) process.compile should not be used. "
"Use require('vm').runInThisContext instead.\n");
}
Local<String> source = args[0]->ToString(); Local<String> source = args[0]->ToString();
Local<String> filename = args[1]->ToString(); Local<String> filename = args[1]->ToString();

Loading…
Cancel
Save