1 From a9e60792a9c4044e29ec7bbb88419d9283044b86 Mon Sep 17 00:00:00 2001
2 From: "T.C. Hollingsworth" <tchollingsworth@gmail.com>
3 Date: Wed, 18 Jun 2014 23:19:19 -0700
4 Subject: [PATCH] Revert "src: replace usage of String::Utf8Value"
6 This reverts commit 535c7777ac674ba86cf93c44824e07b0e23ea8c4.
8 src/cares_wrap.cc | 8 ++---
9 src/fs_event_wrap.cc | 3 +-
10 src/node.cc | 42 +++++++++++++-------------
11 src/node_crypto.cc | 31 ++++++++++---------
12 src/node_dtrace.cc | 6 ++--
13 src/node_file.cc | 37 +++++++++++------------
14 src/node_stat_watcher.cc | 3 +-
15 src/process_wrap.cc | 9 +++---
16 src/udp_wrap.cc | 9 +++---
17 src/util.h | 78 ------------------------------------------------
18 10 files changed, 68 insertions(+), 158 deletions(-)
19 delete mode 100644 src/util.h
21 diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc
22 index 321e144..b7ba828 100644
23 --- a/src/cares_wrap.cc
24 +++ b/src/cares_wrap.cc
31 #if defined(__OpenBSD__) || defined(__MINGW32__) || defined(_MSC_VER)
34 @@ -741,7 +739,7 @@ static Handle<Value> Query(const Arguments& args) {
35 // object reference, causing wrap->GetObject() to return undefined.
36 Local<Object> object = Local<Object>::New(wrap->GetObject());
38 - node::Utf8Value name(args[0]);
39 + String::Utf8Value name(args[0]);
41 int r = wrap->Send(*name);
43 @@ -770,7 +768,7 @@ static Handle<Value> QueryWithFamily(const Arguments& args) {
44 // object reference, causing wrap->GetObject() to return undefined.
45 Local<Object> object = Local<Object>::New(wrap->GetObject());
47 - node::Utf8Value name(args[0]);
48 + String::Utf8Value name(args[0]);
49 int family = args[1]->Int32Value();
51 int r = wrap->Send(*name, family);
52 @@ -900,7 +898,7 @@ static Handle<Value> IsIP(const Arguments& args) {
53 static Handle<Value> GetAddrInfo(const Arguments& args) {
56 - node::Utf8Value hostname(args[0]);
57 + String::Utf8Value hostname(args[0]);
60 if (args[1]->IsInt32()) {
61 diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
62 index fc54283..7e3eb8c 100644
63 --- a/src/fs_event_wrap.cc
64 +++ b/src/fs_event_wrap.cc
68 #include "handle_wrap.h"
73 @@ -98,7 +97,7 @@ Handle<Value> FSEventWrap::Start(const Arguments& args) {
74 return ThrowException(Exception::TypeError(String::New("Bad arguments")));
77 - node::Utf8Value path(args[0]);
78 + String::Utf8Value path(args[0]);
80 int r = uv_fs_event_init(uv_default_loop(), &wrap->handle_, *path, OnEvent, 0);
82 diff --git a/src/node.cc b/src/node.cc
83 index e9696cd..8257604 100644
86 @@ -82,8 +82,6 @@ typedef int mode_t;
87 #include "node_script.h"
88 #include "v8_typed_array.h"
95 @@ -1102,7 +1100,7 @@ enum encoding ParseEncoding(Handle<Value> encoding_v, enum encoding _default) {
97 if (!encoding_v->IsString()) return _default;
99 - node::Utf8Value encoding(encoding_v);
100 + String::Utf8Value encoding(encoding_v);
102 if (strcasecmp(*encoding, "utf8") == 0) {
104 @@ -1202,12 +1200,12 @@ void DisplayExceptionLine (TryCatch &try_catch) {
106 if (!message.IsEmpty()) {
107 // Print (filename):(line number): (message).
108 - node::Utf8Value filename(message->GetScriptResourceName());
109 + String::Utf8Value filename(message->GetScriptResourceName());
110 const char* filename_string = *filename;
111 int linenum = message->GetLineNumber();
112 fprintf(stderr, "%s:%i\n", filename_string, linenum);
113 // Print line of source code.
114 - node::Utf8Value sourceline(message->GetSourceLine());
115 + String::Utf8Value sourceline(message->GetSourceLine());
116 const char* sourceline_string = *sourceline;
118 // Because of how node modules work, all scripts are wrapped with a
119 @@ -1254,7 +1252,7 @@ static void ReportException(TryCatch &try_catch, bool show_line) {
121 if (show_line) DisplayExceptionLine(try_catch);
123 - node::Utf8Value trace(try_catch.StackTrace());
124 + String::Utf8Value trace(try_catch.StackTrace());
126 // range errors have a trace member set to undefined
127 if (trace.length() > 0 && !try_catch.StackTrace()->IsUndefined()) {
128 @@ -1269,11 +1267,11 @@ static void ReportException(TryCatch &try_catch, bool show_line) {
129 !(er->ToObject()->Get(String::New("name"))->IsUndefined());
132 - node::Utf8Value name(er->ToObject()->Get(String::New("name")));
133 + String::Utf8Value name(er->ToObject()->Get(String::New("name")));
134 fprintf(stderr, "%s: ", *name);
137 - node::Utf8Value msg(!isErrorObject ? er
138 + String::Utf8Value msg(!isErrorObject ? er
139 : er->ToObject()->Get(String::New("message")));
140 fprintf(stderr, "%s\n", *msg);
142 @@ -1355,7 +1353,7 @@ static Handle<Value> Chdir(const Arguments& args) {
143 return ThrowException(Exception::Error(String::New("Bad argument.")));
146 - node::Utf8Value path(args[0]);
147 + String::Utf8Value path(args[0]);
149 uv_err_t r = uv_chdir(*path);
151 @@ -1406,7 +1404,7 @@ static Handle<Value> Umask(const Arguments& args) {
152 oct = args[0]->Uint32Value();
155 - node::Utf8Value str(args[0]);
156 + String::Utf8Value str(args[0]);
158 // Parse the octal string.
159 for (int i = 0; i < str.length(); i++) {
160 @@ -1512,7 +1510,7 @@ static uid_t uid_by_name(Handle<Value> value) {
161 if (value->IsUint32()) {
162 return static_cast<uid_t>(value->Uint32Value());
164 - node::Utf8Value name(value);
165 + String::Utf8Value name(value);
166 return uid_by_name(*name);
169 @@ -1522,7 +1520,7 @@ static gid_t gid_by_name(Handle<Value> value) {
170 if (value->IsUint32()) {
171 return static_cast<gid_t>(value->Uint32Value());
173 - node::Utf8Value name(value);
174 + String::Utf8Value name(value);
175 return gid_by_name(*name);
178 @@ -1665,7 +1663,7 @@ static Handle<Value> InitGroups(const Arguments& args) {
179 return ThrowTypeError("argument 2 must be a number or a string");
182 - node::Utf8Value arg0(args[0]);
183 + String::Utf8Value arg0(args[0]);
187 @@ -1826,7 +1824,7 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
190 Local<Object> module = args[0]->ToObject(); // Cast
191 - node::Utf8Value filename(args[1]); // Cast
192 + String::Utf8Value filename(args[1]); // Cast
194 if (exports_symbol.IsEmpty()) {
195 exports_symbol = NODE_PSYMBOL("exports");
196 @@ -1842,7 +1840,7 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
197 return ThrowException(Exception::Error(errmsg));
200 - node::Utf8Value path(args[1]);
201 + String::Utf8Value path(args[1]);
204 /* Find the shared library filename within the full path. */
205 @@ -1961,7 +1959,7 @@ static Handle<Value> Binding(const Arguments& args) {
208 Local<String> module = args[0]->ToString();
209 - node::Utf8Value module_v(module);
210 + String::Utf8Value module_v(module);
211 node_module_struct* modp;
213 if (binding_cache.IsEmpty()) {
214 @@ -2020,7 +2018,7 @@ static void ProcessTitleSetter(Local<String> property,
216 const AccessorInfo& info) {
218 - node::Utf8Value title(value);
219 + String::Utf8Value title(value);
220 // TODO: protect with a lock
221 uv_set_process_title(*title);
223 @@ -2030,7 +2028,7 @@ static Handle<Value> EnvGetter(Local<String> property,
224 const AccessorInfo& info) {
227 - node::Utf8Value key(property);
228 + String::Utf8Value key(property);
229 const char* val = getenv(*key);
231 return scope.Close(String::New(val));
232 @@ -2059,8 +2057,8 @@ static Handle<Value> EnvSetter(Local<String> property,
233 const AccessorInfo& info) {
236 - node::Utf8Value key(property);
237 - node::Utf8Value val(value);
238 + String::Utf8Value key(property);
239 + String::Utf8Value val(value);
240 setenv(*key, *val, 1);
242 String::Value key(property);
243 @@ -2080,7 +2078,7 @@ static Handle<Integer> EnvQuery(Local<String> property,
244 const AccessorInfo& info) {
247 - node::Utf8Value key(property);
248 + String::Utf8Value key(property);
250 return scope.Close(Integer::New(0));
252 @@ -2108,7 +2106,7 @@ static Handle<Boolean> EnvDeleter(Local<String> property,
253 const AccessorInfo& info) {
256 - node::Utf8Value key(property);
257 + String::Utf8Value key(property);
258 if (!getenv(*key)) return False();
259 unsetenv(*key); // can't check return value, it's void on some platforms
261 diff --git a/src/node_crypto.cc b/src/node_crypto.cc
262 index 46faba2..0ae1f8a 100644
263 --- a/src/node_crypto.cc
264 +++ b/src/node_crypto.cc
267 #include "node_buffer.h"
268 #include "string_bytes.h"
273 @@ -242,7 +241,7 @@ Handle<Value> SecureContext::Init(const Arguments& args) {
274 OPENSSL_CONST SSL_METHOD *method = SSLv23_method();
276 if (args.Length() == 1 && args[0]->IsString()) {
277 - node::Utf8Value sslmethod(args[0]);
278 + String::Utf8Value sslmethod(args[0]);
280 if (strcmp(*sslmethod, "SSLv2_method") == 0) {
281 #ifndef OPENSSL_NO_SSL2
282 @@ -362,7 +361,7 @@ static BIO* LoadBIO (Handle<Value> v) {
286 - node::Utf8Value s(v);
287 + String::Utf8Value s(v);
288 r = BIO_write(bio, *s, s.length());
289 } else if (Buffer::HasInstance(v)) {
290 char* buffer_data = Buffer::Data(v);
291 @@ -414,7 +413,7 @@ Handle<Value> SecureContext::SetKey(const Arguments& args) {
292 BIO *bio = LoadBIO(args[0]);
293 if (!bio) return False();
295 - node::Utf8Value passphrase(args[1]);
296 + String::Utf8Value passphrase(args[1]);
298 EVP_PKEY* key = PEM_read_bio_PrivateKey(bio, NULL, NULL,
299 len == 1 ? NULL : *passphrase);
300 @@ -644,7 +643,7 @@ Handle<Value> SecureContext::SetCiphers(const Arguments& args) {
301 return ThrowException(Exception::TypeError(String::New("Bad parameter")));
304 - node::Utf8Value ciphers(args[0]);
305 + String::Utf8Value ciphers(args[0]);
306 SSL_CTX_set_cipher_list(sc->ctx_, *ciphers);
309 @@ -673,7 +672,7 @@ Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) {
310 return ThrowException(Exception::TypeError(String::New("Bad parameter")));
313 - node::Utf8Value sessionIdContext(args[0]);
314 + String::Utf8Value sessionIdContext(args[0]);
315 const unsigned char* sid_ctx = (const unsigned char*) *sessionIdContext;
316 unsigned int sid_ctx_len = sessionIdContext.length();
318 @@ -1281,7 +1280,7 @@ Handle<Value> Connection::New(const Arguments& args) {
320 SSL_CTX_set_tlsext_servername_callback(sc->ctx_, SelectSNIContextCallback_);
322 - node::Utf8Value servername(args[2]);
323 + String::Utf8Value servername(args[2]);
324 SSL_set_tlsext_host_name(p->ssl_, *servername);
327 @@ -2234,7 +2233,7 @@ class Cipher : public ObjectWrap {
328 ssize_t key_written = DecodeWrite(key_buf, key_buf_len, args[1], BINARY);
329 assert(key_written == key_buf_len);
331 - node::Utf8Value cipherType(args[0]);
332 + String::Utf8Value cipherType(args[0]);
334 bool r = cipher->CipherInit(*cipherType, key_buf, key_buf_len);
336 @@ -2285,7 +2284,7 @@ class Cipher : public ObjectWrap {
337 ssize_t iv_written = DecodeWrite(iv_buf, iv_len, args[2], BINARY);
338 assert(iv_written == iv_len);
340 - node::Utf8Value cipherType(args[0]);
341 + String::Utf8Value cipherType(args[0]);
343 bool r = cipher->CipherInitIv(*cipherType, key_buf,key_len,iv_buf,iv_len);
345 @@ -2544,7 +2543,7 @@ class Decipher : public ObjectWrap {
346 ssize_t key_written = DecodeWrite(key_buf, key_len, args[1], BINARY);
347 assert(key_written == key_len);
349 - node::Utf8Value cipherType(args[0]);
350 + String::Utf8Value cipherType(args[0]);
352 bool r = cipher->DecipherInit(*cipherType, key_buf,key_len);
354 @@ -2595,7 +2594,7 @@ class Decipher : public ObjectWrap {
355 ssize_t iv_written = DecodeWrite(iv_buf, iv_len, args[2], BINARY);
356 assert(iv_written == iv_len);
358 - node::Utf8Value cipherType(args[0]);
359 + String::Utf8Value cipherType(args[0]);
361 bool r = cipher->DecipherInitIv(*cipherType, key_buf,key_len,iv_buf,iv_len);
363 @@ -2776,7 +2775,7 @@ class Hmac : public ObjectWrap {
364 return ThrowException(exception);
367 - node::Utf8Value hashType(args[0]);
368 + String::Utf8Value hashType(args[0]);
372 @@ -2921,7 +2920,7 @@ class Hash : public ObjectWrap {
373 "Must give hashtype string as argument")));
376 - node::Utf8Value hashType(args[0]);
377 + String::Utf8Value hashType(args[0]);
379 Hash *hash = new Hash();
380 if (!hash->HashInit(*hashType)) {
381 @@ -3095,7 +3094,7 @@ class Sign : public ObjectWrap {
382 "Must give signtype string as argument")));
385 - node::Utf8Value signType(args[0]);
386 + String::Utf8Value signType(args[0]);
388 bool r = sign->SignInit(*signType);
390 @@ -3328,7 +3327,7 @@ class Verify : public ObjectWrap {
391 "Must give verifytype string as argument")));
394 - node::Utf8Value verifyType(args[0]);
395 + String::Utf8Value verifyType(args[0]);
397 bool r = verify->VerifyInit(*verifyType);
399 @@ -3511,7 +3510,7 @@ class DiffieHellman : public ObjectWrap {
400 String::New("No group name given")));
403 - node::Utf8Value group_name(args[0]);
404 + String::Utf8Value group_name(args[0]);
406 modp_group* it = modp_groups;
408 diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc
409 index 0b2d0f4..4b851e3 100644
410 --- a/src/node_dtrace.cc
411 +++ b/src/node_dtrace.cc
413 // USE OR OTHER DEALINGS IN THE SOFTWARE.
419 #include "node_dtrace.h"
421 @@ -68,7 +66,7 @@ using namespace v8;
422 return (ThrowException(Exception::Error(String::New("expected " \
423 "object for " #obj " to contain string member " #member)))); \
425 - node::Utf8Value _##member(obj->Get(String::New(#member))); \
426 + String::Utf8Value _##member(obj->Get(String::New(#member))); \
427 if ((*(const char **)valp = *_##member) == NULL) \
428 *(const char **)valp = "<unknown>";
430 @@ -243,7 +241,7 @@ Handle<Value> DTRACE_HTTP_SERVER_REQUEST(const Arguments& args) {
431 "object for request to contain string member headers"))));
433 Local<Value> strfwdfor = headers->Get(String::New("x-forwarded-for"));
434 - node::Utf8Value fwdfor(strfwdfor);
435 + String::Utf8Value fwdfor(strfwdfor);
437 if (!strfwdfor->IsString() || (req.forwardedFor = *fwdfor) == NULL)
438 req.forwardedFor = const_cast<char*>("");
439 diff --git a/src/node_file.cc b/src/node_file.cc
440 index 3c35e0b..f665b19 100644
441 --- a/src/node_file.cc
442 +++ b/src/node_file.cc
444 #include "node_buffer.h"
445 #include "node_stat_watcher.h"
446 #include "req_wrap.h"
450 #include <sys/types.h>
451 @@ -404,7 +403,7 @@ static Handle<Value> Stat(const Arguments& args) {
452 if (args.Length() < 1) return TYPE_ERROR("path required");
453 if (!args[0]->IsString()) return TYPE_ERROR("path must be a string");
455 - node::Utf8Value path(args[0]);
456 + String::Utf8Value path(args[0]);
458 if (args[1]->IsFunction()) {
459 ASYNC_CALL(stat, args[1], *path)
460 @@ -421,7 +420,7 @@ static Handle<Value> LStat(const Arguments& args) {
461 if (args.Length() < 1) return TYPE_ERROR("path required");
462 if (!args[0]->IsString()) return TYPE_ERROR("path must be a string");
464 - node::Utf8Value path(args[0]);
465 + String::Utf8Value path(args[0]);
467 if (args[1]->IsFunction()) {
468 ASYNC_CALL(lstat, args[1], *path)
469 @@ -459,12 +458,12 @@ static Handle<Value> Symlink(const Arguments& args) {
470 if (!args[0]->IsString()) return TYPE_ERROR("dest path must be a string");
471 if (!args[1]->IsString()) return TYPE_ERROR("src path must be a string");
473 - node::Utf8Value dest(args[0]);
474 - node::Utf8Value path(args[1]);
475 + String::Utf8Value dest(args[0]);
476 + String::Utf8Value path(args[1]);
479 if (args[2]->IsString()) {
480 - node::Utf8Value mode(args[2]);
481 + String::Utf8Value mode(args[2]);
482 if (strcmp(*mode, "dir") == 0) {
483 flags |= UV_FS_SYMLINK_DIR;
484 } else if (strcmp(*mode, "junction") == 0) {
485 @@ -492,8 +491,8 @@ static Handle<Value> Link(const Arguments& args) {
486 if (!args[0]->IsString()) return TYPE_ERROR("dest path must be a string");
487 if (!args[1]->IsString()) return TYPE_ERROR("src path must be a string");
489 - node::Utf8Value orig_path(args[0]);
490 - node::Utf8Value new_path(args[1]);
491 + String::Utf8Value orig_path(args[0]);
492 + String::Utf8Value new_path(args[1]);
494 if (args[2]->IsFunction()) {
495 ASYNC_DEST_CALL(link, args[2], *new_path, *orig_path, *new_path)
496 @@ -509,7 +508,7 @@ static Handle<Value> ReadLink(const Arguments& args) {
497 if (args.Length() < 1) return TYPE_ERROR("path required");
498 if (!args[0]->IsString()) return TYPE_ERROR("path must be a string");
500 - node::Utf8Value path(args[0]);
501 + String::Utf8Value path(args[0]);
503 if (args[1]->IsFunction()) {
504 ASYNC_CALL(readlink, args[1], *path)
505 @@ -528,8 +527,8 @@ static Handle<Value> Rename(const Arguments& args) {
506 if (!args[0]->IsString()) return TYPE_ERROR("old path must be a string");
507 if (!args[1]->IsString()) return TYPE_ERROR("new path must be a string");
509 - node::Utf8Value old_path(args[0]);
510 - node::Utf8Value new_path(args[1]);
511 + String::Utf8Value old_path(args[0]);
512 + String::Utf8Value new_path(args[1]);
514 if (args[2]->IsFunction()) {
515 ASYNC_DEST_CALL(rename, args[2], *new_path, *old_path, *new_path)
516 @@ -599,7 +598,7 @@ static Handle<Value> Unlink(const Arguments& args) {
517 if (args.Length() < 1) return TYPE_ERROR("path required");
518 if (!args[0]->IsString()) return TYPE_ERROR("path must be a string");
520 - node::Utf8Value path(args[0]);
521 + String::Utf8Value path(args[0]);
523 if (args[1]->IsFunction()) {
524 ASYNC_CALL(unlink, args[1], *path)
525 @@ -615,7 +614,7 @@ static Handle<Value> RMDir(const Arguments& args) {
526 if (args.Length() < 1) return TYPE_ERROR("path required");
527 if (!args[0]->IsString()) return TYPE_ERROR("path must be a string");
529 - node::Utf8Value path(args[0]);
530 + String::Utf8Value path(args[0]);
532 if (args[1]->IsFunction()) {
533 ASYNC_CALL(rmdir, args[1], *path)
534 @@ -632,7 +631,7 @@ static Handle<Value> MKDir(const Arguments& args) {
535 return THROW_BAD_ARGS;
538 - node::Utf8Value path(args[0]);
539 + String::Utf8Value path(args[0]);
540 int mode = static_cast<int>(args[1]->Int32Value());
542 if (args[2]->IsFunction()) {
543 @@ -649,7 +648,7 @@ static Handle<Value> ReadDir(const Arguments& args) {
544 if (args.Length() < 1) return TYPE_ERROR("path required");
545 if (!args[0]->IsString()) return TYPE_ERROR("path must be a string");
547 - node::Utf8Value path(args[0]);
548 + String::Utf8Value path(args[0]);
550 if (args[1]->IsFunction()) {
551 ASYNC_CALL(readdir, args[1], *path, 0 /*flags*/)
552 @@ -687,7 +686,7 @@ static Handle<Value> Open(const Arguments& args) {
553 if (!args[1]->IsInt32()) return TYPE_ERROR("flags must be an int");
554 if (!args[2]->IsInt32()) return TYPE_ERROR("mode must be an int");
556 - node::Utf8Value path(args[0]);
557 + String::Utf8Value path(args[0]);
558 int flags = args[1]->Int32Value();
559 int mode = static_cast<int>(args[2]->Int32Value());
561 @@ -827,7 +826,7 @@ static Handle<Value> Chmod(const Arguments& args) {
562 if(args.Length() < 2 || !args[0]->IsString() || !args[1]->IsInt32()) {
563 return THROW_BAD_ARGS;
565 - node::Utf8Value path(args[0]);
566 + String::Utf8Value path(args[0]);
567 int mode = static_cast<int>(args[1]->Int32Value());
569 if(args[2]->IsFunction()) {
570 @@ -874,7 +873,7 @@ static Handle<Value> Chown(const Arguments& args) {
571 if (!args[1]->IsUint32()) return TYPE_ERROR("uid must be an unsigned int");
572 if (!args[2]->IsUint32()) return TYPE_ERROR("gid must be an unsigned int");
574 - node::Utf8Value path(args[0]);
575 + String::Utf8Value path(args[0]);
576 uv_uid_t uid = static_cast<uv_uid_t>(args[1]->Uint32Value());
577 uv_gid_t gid = static_cast<uv_gid_t>(args[2]->Uint32Value());
579 @@ -925,7 +924,7 @@ static Handle<Value> UTimes(const Arguments& args) {
580 if (!args[1]->IsNumber()) return TYPE_ERROR("atime must be a number");
581 if (!args[2]->IsNumber()) return TYPE_ERROR("mtime must be a number");
583 - const node::Utf8Value path(args[0]);
584 + const String::Utf8Value path(args[0]);
585 const double atime = static_cast<double>(args[1]->NumberValue());
586 const double mtime = static_cast<double>(args[2]->NumberValue());
588 diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc
589 index fd3e5d1..c3f668c 100644
590 --- a/src/node_stat_watcher.cc
591 +++ b/src/node_stat_watcher.cc
593 // USE OR OTHER DEALINGS IN THE SOFTWARE.
595 #include "node_stat_watcher.h"
600 @@ -105,7 +104,7 @@ Handle<Value> StatWatcher::Start(const Arguments& args) {
603 StatWatcher* wrap = ObjectWrap::Unwrap<StatWatcher>(args.Holder());
604 - node::Utf8Value path(args[0]);
605 + String::Utf8Value path(args[0]);
606 const bool persistent = args[1]->BooleanValue();
607 const uint32_t interval = args[2]->Uint32Value();
609 diff --git a/src/process_wrap.cc b/src/process_wrap.cc
610 index ac63e4b..784300f 100644
611 --- a/src/process_wrap.cc
612 +++ b/src/process_wrap.cc
614 #include "tty_wrap.h"
615 #include "tcp_wrap.h"
616 #include "udp_wrap.h"
621 @@ -188,7 +187,7 @@ class ProcessWrap : public HandleWrap {
624 Local<Value> file_v = js_options->Get(String::NewSymbol("file"));
625 - node::Utf8Value file(file_v->IsString() ? file_v : Local<Value>());
626 + String::Utf8Value file(file_v->IsString() ? file_v : Local<Value>());
627 if (file.length() > 0) {
628 options.file = *file;
630 @@ -203,7 +202,7 @@ class ProcessWrap : public HandleWrap {
631 // Heap allocate to detect errors. +1 is for NULL.
632 options.args = new char*[argc + 1];
633 for (int i = 0; i < argc; i++) {
634 - node::Utf8Value arg(js_argv->Get(i));
635 + String::Utf8Value arg(js_argv->Get(i));
636 options.args[i] = strdup(*arg);
638 options.args[argc] = NULL;
639 @@ -211,7 +210,7 @@ class ProcessWrap : public HandleWrap {
642 Local<Value> cwd_v = js_options->Get(String::NewSymbol("cwd"));
643 - node::Utf8Value cwd(cwd_v->IsString() ? cwd_v : Local<Value>());
644 + String::Utf8Value cwd(cwd_v->IsString() ? cwd_v : Local<Value>());
645 if (cwd.length() > 0) {
648 @@ -223,7 +222,7 @@ class ProcessWrap : public HandleWrap {
649 int envc = env->Length();
650 options.env = new char*[envc + 1]; // Heap allocated to detect errors.
651 for (int i = 0; i < envc; i++) {
652 - node::Utf8Value pair(env->Get(i));
653 + String::Utf8Value pair(env->Get(i));
654 options.env[i] = strdup(*pair);
656 options.env[envc] = NULL;
657 diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc
658 index 31a4e78..b33f4e8 100644
659 --- a/src/udp_wrap.cc
660 +++ b/src/udp_wrap.cc
662 #include "req_wrap.h"
663 #include "handle_wrap.h"
664 #include "udp_wrap.h"
669 @@ -161,7 +160,7 @@ Handle<Value> UDPWrap::DoBind(const Arguments& args, int family) {
670 // bind(ip, port, flags)
671 assert(args.Length() == 3);
673 - node::Utf8Value address(args[0]);
674 + String::Utf8Value address(args[0]);
675 const int port = args[1]->Uint32Value();
676 const int flags = args[2]->Uint32Value();
678 @@ -220,8 +219,8 @@ Handle<Value> UDPWrap::SetMembership(const Arguments& args,
680 assert(args.Length() == 2);
682 - node::Utf8Value address(args[0]);
683 - node::Utf8Value iface(args[1]);
684 + String::Utf8Value address(args[0]);
685 + String::Utf8Value iface(args[1]);
687 const char* iface_cstr = *iface;
688 if (args[1]->IsUndefined() || args[1]->IsNull()) {
689 @@ -272,7 +271,7 @@ Handle<Value> UDPWrap::DoSend(const Arguments& args, int family) {
692 const unsigned short port = args[3]->Uint32Value();
693 - node::Utf8Value address(args[4]);
694 + String::Utf8Value address(args[4]);
698 diff --git a/src/util.h b/src/util.h
699 deleted file mode 100644
700 index 0dbf7f4..0000000
704 -// Copyright Joyent, Inc. and other Node contributors.
706 -// Permission is hereby granted, free of charge, to any person obtaining a
707 -// copy of this software and associated documentation files (the
708 -// "Software"), to deal in the Software without restriction, including
709 -// without limitation the rights to use, copy, modify, merge, publish,
710 -// distribute, sublicense, and/or sell copies of the Software, and to permit
711 -// persons to whom the Software is furnished to do so, subject to the
712 -// following conditions:
714 -// The above copyright notice and this permission notice shall be included
715 -// in all copies or substantial portions of the Software.
717 -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
718 -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
719 -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
720 -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
721 -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
722 -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
723 -// USE OR OTHER DEALINGS IN THE SOFTWARE.
729 -#include "string_bytes.h"
735 - explicit Utf8Value(v8::Handle<v8::Value> value)
736 - : length_(0), str_(NULL) {
737 - if (value.IsEmpty())
740 - v8::Local<v8::String> val_ = value->ToString();
742 - // Allocate enough space to include the null terminator
743 - size_t len = StringBytes::StorageSize(val_, UTF8) + 1;
745 - char* str = static_cast<char*>(calloc(1, len));
747 - int flags = WRITE_UTF8_FLAGS;
748 - flags |= ~v8::String::NO_NULL_TERMINATION;
750 - length_ = val_->WriteUtf8(str,
755 - str_ = reinterpret_cast<char*>(str);
762 - char* operator*() {
766 - const char* operator*() const {
770 - size_t length() const {
781 -#endif // SRC_UTIL_H_