From: Ryan Dahl Date: Sun, 21 Nov 2010 23:22:08 +0000 (-0800) Subject: Print deprecation warning on process.compile X-Git-Tag: v0.3.2~188 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6479f2fb62daf1f4d46e0ff4d6012995d079cd1;p=platform%2Fupstream%2Fnodejs.git Print deprecation warning on process.compile --- diff --git a/src/node.cc b/src/node.cc index 46c56e2..f87e913 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1318,14 +1318,24 @@ Handle DLOpen(const v8::Arguments& args) { } +// TODO remove me before 0.4 Handle Compile(const Arguments& args) { HandleScope scope; + if (args.Length() < 2) { return ThrowException(Exception::TypeError( 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 source = args[0]->ToString(); Local filename = args[1]->ToString();