Skip to content

Commit f6479f2

Browse files
committed
Print deprecation warning on process.compile
1 parent a16b3c3 commit f6479f2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/node.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,14 +1318,24 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
13181318
}
13191319

13201320

1321+
// TODO remove me before 0.4
13211322
Handle<Value> Compile(const Arguments& args) {
13221323
HandleScope scope;
13231324

1325+
13241326
if (args.Length() < 2) {
13251327
return ThrowException(Exception::TypeError(
13261328
String::New("needs two arguments.")));
13271329
}
13281330

1331+
static bool shown_error_message = false;
1332+
1333+
if (!shown_error_message) {
1334+
shown_error_message = true;
1335+
fprintf(stderr, "(node) process.compile should not be used. "
1336+
"Use require('vm').runInThisContext instead.\n");
1337+
}
1338+
13291339
Local<String> source = args[0]->ToString();
13301340
Local<String> filename = args[1]->ToString();
13311341

0 commit comments

Comments
 (0)