@@ -82,6 +82,8 @@ typedef int mode_t;
8282#include " node_script.h"
8383#include " v8_typed_array.h"
8484
85+ #include " util.h"
86+
8587using namespace v8 ;
8688
8789# ifdef __APPLE__
@@ -1102,7 +1104,7 @@ enum encoding ParseEncoding(Handle<Value> encoding_v, enum encoding _default) {
11021104
11031105 if (!encoding_v->IsString ()) return _default;
11041106
1105- String ::Utf8Value encoding (encoding_v);
1107+ node ::Utf8Value encoding (encoding_v);
11061108
11071109 if (strcasecmp (*encoding, " utf8" ) == 0 ) {
11081110 return UTF8;
@@ -1202,12 +1204,12 @@ void DisplayExceptionLine (TryCatch &try_catch) {
12021204
12031205 if (!message.IsEmpty ()) {
12041206 // Print (filename):(line number): (message).
1205- String ::Utf8Value filename (message->GetScriptResourceName ());
1207+ node ::Utf8Value filename (message->GetScriptResourceName ());
12061208 const char * filename_string = *filename;
12071209 int linenum = message->GetLineNumber ();
12081210 fprintf (stderr, " %s:%i\n " , filename_string, linenum);
12091211 // Print line of source code.
1210- String ::Utf8Value sourceline (message->GetSourceLine ());
1212+ node ::Utf8Value sourceline (message->GetSourceLine ());
12111213 const char * sourceline_string = *sourceline;
12121214
12131215 // Because of how node modules work, all scripts are wrapped with a
@@ -1254,7 +1256,7 @@ static void ReportException(TryCatch &try_catch, bool show_line) {
12541256
12551257 if (show_line) DisplayExceptionLine (try_catch);
12561258
1257- String ::Utf8Value trace (try_catch.StackTrace ());
1259+ node ::Utf8Value trace (try_catch.StackTrace ());
12581260
12591261 // range errors have a trace member set to undefined
12601262 if (trace.length () > 0 && !try_catch.StackTrace ()->IsUndefined ()) {
@@ -1269,11 +1271,11 @@ static void ReportException(TryCatch &try_catch, bool show_line) {
12691271 !(er->ToObject ()->Get (String::New (" name" ))->IsUndefined ());
12701272
12711273 if (isErrorObject) {
1272- String ::Utf8Value name (er->ToObject ()->Get (String::New (" name" )));
1274+ node ::Utf8Value name (er->ToObject ()->Get (String::New (" name" )));
12731275 fprintf (stderr, " %s: " , *name);
12741276 }
12751277
1276- String ::Utf8Value msg (!isErrorObject ? er
1278+ node ::Utf8Value msg (!isErrorObject ? er
12771279 : er->ToObject ()->Get (String::New (" message" )));
12781280 fprintf (stderr, " %s\n " , *msg);
12791281 }
@@ -1355,7 +1357,7 @@ static Handle<Value> Chdir(const Arguments& args) {
13551357 return ThrowException (Exception::Error (String::New (" Bad argument." )));
13561358 }
13571359
1358- String ::Utf8Value path (args[0 ]);
1360+ node ::Utf8Value path (args[0 ]);
13591361
13601362 uv_err_t r = uv_chdir (*path);
13611363
@@ -1406,7 +1408,7 @@ static Handle<Value> Umask(const Arguments& args) {
14061408 oct = args[0 ]->Uint32Value ();
14071409 } else {
14081410 oct = 0 ;
1409- String ::Utf8Value str (args[0 ]);
1411+ node ::Utf8Value str (args[0 ]);
14101412
14111413 // Parse the octal string.
14121414 for (int i = 0 ; i < str.length (); i++) {
@@ -1512,7 +1514,7 @@ static uid_t uid_by_name(Handle<Value> value) {
15121514 if (value->IsUint32 ()) {
15131515 return static_cast <uid_t >(value->Uint32Value ());
15141516 } else {
1515- String ::Utf8Value name (value);
1517+ node ::Utf8Value name (value);
15161518 return uid_by_name (*name);
15171519 }
15181520}
@@ -1522,7 +1524,7 @@ static gid_t gid_by_name(Handle<Value> value) {
15221524 if (value->IsUint32 ()) {
15231525 return static_cast <gid_t >(value->Uint32Value ());
15241526 } else {
1525- String ::Utf8Value name (value);
1527+ node ::Utf8Value name (value);
15261528 return gid_by_name (*name);
15271529 }
15281530}
@@ -1665,7 +1667,7 @@ static Handle<Value> InitGroups(const Arguments& args) {
16651667 return ThrowTypeError (" argument 2 must be a number or a string" );
16661668 }
16671669
1668- String ::Utf8Value arg0 (args[0 ]);
1670+ node ::Utf8Value arg0 (args[0 ]);
16691671 gid_t extra_group;
16701672 bool must_free;
16711673 char * user;
@@ -1826,7 +1828,7 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
18261828 }
18271829
18281830 Local<Object> module = args[0 ]->ToObject (); // Cast
1829- String ::Utf8Value filename (args[1 ]); // Cast
1831+ node ::Utf8Value filename (args[1 ]); // Cast
18301832
18311833 if (exports_symbol.IsEmpty ()) {
18321834 exports_symbol = NODE_PSYMBOL (" exports" );
@@ -1842,7 +1844,7 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
18421844 return ThrowException (Exception::Error (errmsg));
18431845 }
18441846
1845- String ::Utf8Value path (args[1 ]);
1847+ node ::Utf8Value path (args[1 ]);
18461848 base = *path;
18471849
18481850 /* Find the shared library filename within the full path. */
@@ -1961,7 +1963,7 @@ static Handle<Value> Binding(const Arguments& args) {
19611963 HandleScope scope;
19621964
19631965 Local<String> module = args[0 ]->ToString ();
1964- String ::Utf8Value module_v (module );
1966+ node ::Utf8Value module_v (module );
19651967 node_module_struct* modp;
19661968
19671969 if (binding_cache.IsEmpty ()) {
@@ -2020,7 +2022,7 @@ static void ProcessTitleSetter(Local<String> property,
20202022 Local<Value> value,
20212023 const AccessorInfo& info) {
20222024 HandleScope scope;
2023- String ::Utf8Value title (value);
2025+ node ::Utf8Value title (value);
20242026 // TODO: protect with a lock
20252027 uv_set_process_title (*title);
20262028}
@@ -2030,7 +2032,7 @@ static Handle<Value> EnvGetter(Local<String> property,
20302032 const AccessorInfo& info) {
20312033 HandleScope scope;
20322034#ifdef __POSIX__
2033- String ::Utf8Value key (property);
2035+ node ::Utf8Value key (property);
20342036 const char * val = getenv (*key);
20352037 if (val) {
20362038 return scope.Close (String::New (val));
@@ -2059,8 +2061,8 @@ static Handle<Value> EnvSetter(Local<String> property,
20592061 const AccessorInfo& info) {
20602062 HandleScope scope;
20612063#ifdef __POSIX__
2062- String ::Utf8Value key (property);
2063- String ::Utf8Value val (value);
2064+ node ::Utf8Value key (property);
2065+ node ::Utf8Value val (value);
20642066 setenv (*key, *val, 1 );
20652067#else // _WIN32
20662068 String::Value key (property);
@@ -2080,7 +2082,7 @@ static Handle<Integer> EnvQuery(Local<String> property,
20802082 const AccessorInfo& info) {
20812083 HandleScope scope;
20822084#ifdef __POSIX__
2083- String ::Utf8Value key (property);
2085+ node ::Utf8Value key (property);
20842086 if (getenv (*key)) {
20852087 return scope.Close (Integer::New (0 ));
20862088 }
@@ -2108,7 +2110,7 @@ static Handle<Boolean> EnvDeleter(Local<String> property,
21082110 const AccessorInfo& info) {
21092111 HandleScope scope;
21102112#ifdef __POSIX__
2111- String ::Utf8Value key (property);
2113+ node ::Utf8Value key (property);
21122114 if (!getenv (*key)) return False ();
21132115 unsetenv (*key); // can't check return value, it's void on some platforms
21142116 return True ();
0 commit comments