@@ -147,29 +147,31 @@ void NodeBindings::Initialize() {
147
147
148
148
node::Environment* NodeBindings::CreateEnvironment (
149
149
v8::Handle<v8::Context> context) {
150
+ CommandLine* command_line = CommandLine::ForCurrentProcess ();
150
151
std::vector<std::string> args =
151
152
#if defined(OS_WIN)
152
- String16VectorToStringVector (CommandLine::ForCurrentProcess () ->argv ());
153
+ String16VectorToStringVector (command_line ->argv ());
153
154
#else
154
- CommandLine::ForCurrentProcess () ->argv ();
155
+ command_line ->argv ();
155
156
#endif
156
157
157
158
// Feed node the path to initialization script.
158
- base::FilePath exec_path (CommandLine::ForCurrentProcess () ->argv ()[0 ]);
159
+ base::FilePath exec_path (command_line ->argv ()[0 ]);
159
160
PathService::Get (base::FILE_EXE, &exec_path);
160
161
base::FilePath resources_path =
161
162
#if defined(OS_MACOSX)
162
163
is_browser_ ? exec_path.DirName ().DirName ().Append (" Resources" ) :
163
164
exec_path.DirName ().DirName ().DirName ().DirName ().DirName ()
164
165
.Append (" Resources" );
165
166
#else
166
- exec_path.DirName ().AppendASCII ( " resources" );
167
+ exec_path.DirName ().Append ( FILE_PATH_LITERAL ( " resources" ) );
167
168
#endif
168
169
base::FilePath script_path =
169
- resources_path.AppendASCII (" atom" )
170
- .AppendASCII (is_browser_ ? " browser" : " renderer" )
171
- .AppendASCII (" lib" )
172
- .AppendASCII (" init.js" );
170
+ resources_path.Append (FILE_PATH_LITERAL (" atom" ))
171
+ .Append (is_browser_ ? FILE_PATH_LITERAL (" browser" ) :
172
+ FILE_PATH_LITERAL (" renderer" ))
173
+ .Append (FILE_PATH_LITERAL (" lib" ))
174
+ .Append (FILE_PATH_LITERAL (" init.js" ));
173
175
std::string script_path_str = script_path.AsUTF8Unsafe ();
174
176
args.insert (args.begin () + 1 , script_path_str.c_str ());
175
177
0 commit comments