 +#endif
 +            "process.chdir(require('path').dirname(process.mainModule.filename));"
 +            "process.mainModule.paths = require('module')._nodeModulePaths(process.cwd());"
-+
++        ));
++        script->Run();
++    }
++
++    if (use_node || is_nw_protocol) {
++        v8::Local<v8::Script> script = v8::Script::New(v8::String::New(
 +            // Use WebKit's console globally
 +            "global.console = console;"
 +

 
     initializeV8IfNeeded();
 
@@ -328,7 +334,43 @@ bool V8DOMWindowShell::initContextIfNeeded()
 
     updateDocument();
 

 
     if (m_frame->document())
         context->AllowCodeGenerationFromStrings(m_frame->document()->contentSecurityPolicy()->allowEval(0, ContentSecurityPolicy::SuppressReport));
@@ -339,6 +382,36 @@ bool V8DOMWindowShell::initContextIfNeeded()
     // we do isolated worlds the WebCore way.
     m_frame->loader()->dispatchDidClearWindowObjectInWorld(0);
 
