Browse Source

src, test: downgrade to v8 3.14 api

v0.9.11-release
Ben Noordhuis 12 years ago
parent
commit
51f6e6a9b3
  1. 50
      src/cares_wrap.cc
  2. 12
      src/fs_event_wrap.cc
  3. 14
      src/handle_wrap.cc
  4. 119
      src/node.cc
  5. 58
      src/node_buffer.cc
  6. 12
      src/node_counters.cc
  7. 137
      src/node_crypto.cc
  8. 32
      src/node_dtrace.cc
  9. 52
      src/node_file.cc
  10. 32
      src/node_http_parser.cc
  11. 2
      src/node_internals.h
  12. 4
      src/node_object_wrap.h
  13. 24
      src/node_os.cc
  14. 2
      src/node_script.cc
  15. 6
      src/node_stat_watcher.cc
  16. 13
      src/node_zlib.cc
  17. 22
      src/pipe_wrap.cc
  18. 8
      src/process_wrap.cc
  19. 6
      src/signal_wrap.cc
  20. 4
      src/slab_allocator.cc
  21. 40
      src/stream_wrap.cc
  22. 42
      src/tcp_wrap.cc
  23. 12
      src/timer_wrap.cc
  24. 16
      src/tty_wrap.cc
  25. 39
      src/udp_wrap.cc
  26. 10
      src/v8_typed_array.cc
  27. 10
      test/message/stack_overflow.out

50
src/cares_wrap.cc

@ -203,7 +203,7 @@ static Local<Array> HostentToAddresses(struct hostent* host) {
uv_inet_ntop(host->h_addrtype, host->h_addr_list[i], ip, sizeof(ip)); uv_inet_ntop(host->h_addrtype, host->h_addr_list[i], ip, sizeof(ip));
Local<String> address = String::New(ip); Local<String> address = String::New(ip);
addresses->Set(Integer::New(i, node_isolate), address); addresses->Set(Integer::New(i), address);
} }
return scope.Close(addresses); return scope.Close(addresses);
@ -216,7 +216,7 @@ static Local<Array> HostentToNames(struct hostent* host) {
for (int i = 0; host->h_aliases[i]; ++i) { for (int i = 0; host->h_aliases[i]; ++i) {
Local<String> address = String::New(host->h_aliases[i]); Local<String> address = String::New(host->h_aliases[i]);
names->Set(Integer::New(i, node_isolate), address); names->Set(Integer::New(i), address);
} }
return scope.Close(names); return scope.Close(names);
@ -337,13 +337,13 @@ class QueryWrap {
void CallOnComplete(Local<Value> answer) { void CallOnComplete(Local<Value> answer) {
HandleScope scope; HandleScope scope;
Local<Value> argv[2] = { Integer::New(0, node_isolate), answer }; Local<Value> argv[2] = { Integer::New(0), answer };
MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv); MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv);
} }
void CallOnComplete(Local<Value> answer, Local<Value> family) { void CallOnComplete(Local<Value> answer, Local<Value> family) {
HandleScope scope; HandleScope scope;
Local<Value> argv[3] = { Integer::New(0, node_isolate), answer, family }; Local<Value> argv[3] = { Integer::New(0), answer, family };
MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv); MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv);
} }
@ -352,7 +352,7 @@ class QueryWrap {
SetAresErrno(status); SetAresErrno(status);
HandleScope scope; HandleScope scope;
Local<Value> argv[1] = { Integer::New(-1, node_isolate) }; Local<Value> argv[1] = { Integer::New(-1) };
MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv); MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv);
} }
@ -492,8 +492,8 @@ class QueryMxWrap: public QueryWrap {
Local<Object> mx_record = Object::New(); Local<Object> mx_record = Object::New();
mx_record->Set(exchange_symbol, String::New(mx_current->host)); mx_record->Set(exchange_symbol, String::New(mx_current->host));
mx_record->Set(priority_symbol, mx_record->Set(priority_symbol,
Integer::New(mx_current->priority, node_isolate)); Integer::New(mx_current->priority));
mx_records->Set(Integer::New(i++, node_isolate), mx_record); mx_records->Set(Integer::New(i++), mx_record);
} }
ares_free_data(mx_start); ares_free_data(mx_start);
@ -550,7 +550,7 @@ class QueryTxtWrap: public QueryWrap {
struct ares_txt_reply *current = txt_out; struct ares_txt_reply *current = txt_out;
for (int i = 0; current; ++i, current = current->next) { for (int i = 0; current; ++i, current = current->next) {
Local<String> txt = String::New(reinterpret_cast<char*>(current->txt)); Local<String> txt = String::New(reinterpret_cast<char*>(current->txt));
txt_records->Set(Integer::New(i, node_isolate), txt); txt_records->Set(Integer::New(i), txt);
} }
ares_free_data(txt_out); ares_free_data(txt_out);
@ -595,12 +595,12 @@ class QuerySrvWrap: public QueryWrap {
Local<Object> srv_record = Object::New(); Local<Object> srv_record = Object::New();
srv_record->Set(name_symbol, String::New(srv_current->host)); srv_record->Set(name_symbol, String::New(srv_current->host));
srv_record->Set(port_symbol, srv_record->Set(port_symbol,
Integer::New(srv_current->port, node_isolate)); Integer::New(srv_current->port));
srv_record->Set(priority_symbol, srv_record->Set(priority_symbol,
Integer::New(srv_current->priority, node_isolate)); Integer::New(srv_current->priority));
srv_record->Set(weight_symbol, srv_record->Set(weight_symbol,
Integer::New(srv_current->weight, node_isolate)); Integer::New(srv_current->weight));
srv_records->Set(Integer::New(i++, node_isolate), srv_record); srv_records->Set(Integer::New(i++), srv_record);
} }
ares_free_data(srv_start); ares_free_data(srv_start);
@ -656,7 +656,7 @@ class GetHostByNameWrap: public QueryWrap {
HandleScope scope; HandleScope scope;
Local<Array> addresses = HostentToAddresses(host); Local<Array> addresses = HostentToAddresses(host);
Local<Integer> family = Integer::New(host->h_addrtype, node_isolate); Local<Integer> family = Integer::New(host->h_addrtype);
this->CallOnComplete(addresses, family); this->CallOnComplete(addresses, family);
} }
@ -677,7 +677,7 @@ static Handle<Value> Query(const Arguments& args) {
// We must cache the wrap's js object here, because cares might make the // We must cache the wrap's js object here, because cares might make the
// callback from the wrap->Send stack. This will destroy the wrap's internal // callback from the wrap->Send stack. This will destroy the wrap's internal
// object reference, causing wrap->GetObject() to return undefined. // object reference, causing wrap->GetObject() to return undefined.
Local<Object> object = Local<Object>::New(node_isolate, wrap->GetObject()); Local<Object> object = Local<Object>::New(wrap->GetObject());
String::Utf8Value name(args[0]); String::Utf8Value name(args[0]);
@ -685,7 +685,7 @@ static Handle<Value> Query(const Arguments& args) {
if (r) { if (r) {
SetAresErrno(r); SetAresErrno(r);
delete wrap; delete wrap;
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} else { } else {
return scope.Close(object); return scope.Close(object);
} }
@ -706,7 +706,7 @@ static Handle<Value> QueryWithFamily(const Arguments& args) {
// We must cache the wrap's js object here, because cares might make the // We must cache the wrap's js object here, because cares might make the
// callback from the wrap->Send stack. This will destroy the wrap's internal // callback from the wrap->Send stack. This will destroy the wrap's internal
// object reference, causing wrap->GetObject() to return undefined. // object reference, causing wrap->GetObject() to return undefined.
Local<Object> object = Local<Object>::New(node_isolate, wrap->GetObject()); Local<Object> object = Local<Object>::New(wrap->GetObject());
String::Utf8Value name(args[0]); String::Utf8Value name(args[0]);
int family = args[1]->Int32Value(); int family = args[1]->Int32Value();
@ -715,7 +715,7 @@ static Handle<Value> QueryWithFamily(const Arguments& args) {
if (r) { if (r) {
SetAresErrno(r); SetAresErrno(r);
delete wrap; delete wrap;
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} else { } else {
return scope.Close(object); return scope.Close(object);
} }
@ -732,7 +732,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
if (status) { if (status) {
// Error // Error
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
argv[0] = Local<Value>::New(node_isolate, Null(node_isolate)); argv[0] = Local<Value>::New(Null());
} else { } else {
// Success // Success
struct addrinfo *address; struct addrinfo *address;
@ -824,14 +824,14 @@ static Handle<Value> IsIP(const Arguments& args) {
char address_buffer[sizeof(struct in6_addr)]; char address_buffer[sizeof(struct in6_addr)];
if (uv_inet_pton(AF_INET, *ip, &address_buffer).code == UV_OK) { if (uv_inet_pton(AF_INET, *ip, &address_buffer).code == UV_OK) {
return scope.Close(v8::Integer::New(4, node_isolate)); return scope.Close(v8::Integer::New(4));
} }
if (uv_inet_pton(AF_INET6, *ip, &address_buffer).code == UV_OK) { if (uv_inet_pton(AF_INET6, *ip, &address_buffer).code == UV_OK) {
return scope.Close(v8::Integer::New(6, node_isolate)); return scope.Close(v8::Integer::New(6));
} }
return scope.Close(v8::Integer::New(0, node_isolate)); return scope.Close(v8::Integer::New(0));
} }
@ -871,7 +871,7 @@ static Handle<Value> GetAddrInfo(const Arguments& args) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap; delete req_wrap;
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} else { } else {
return scope.Close(req_wrap->object_); return scope.Close(req_wrap->object_);
} }
@ -915,11 +915,11 @@ static void Initialize(Handle<Object> target) {
NODE_SET_METHOD(target, "isIP", IsIP); NODE_SET_METHOD(target, "isIP", IsIP);
target->Set(String::NewSymbol("AF_INET"), target->Set(String::NewSymbol("AF_INET"),
Integer::New(AF_INET, node_isolate)); Integer::New(AF_INET));
target->Set(String::NewSymbol("AF_INET6"), target->Set(String::NewSymbol("AF_INET6"),
Integer::New(AF_INET6, node_isolate)); Integer::New(AF_INET6));
target->Set(String::NewSymbol("AF_UNSPEC"), target->Set(String::NewSymbol("AF_UNSPEC"),
Integer::New(AF_UNSPEC, node_isolate)); Integer::New(AF_UNSPEC));
oncomplete_sym = NODE_PSYMBOL("oncomplete"); oncomplete_sym = NODE_PSYMBOL("oncomplete");
} }

12
src/fs_event_wrap.cc

@ -110,7 +110,7 @@ Handle<Value> FSEventWrap::Start(const Arguments& args) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
} }
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -136,7 +136,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
// unreasonable, right? Still, we should revisit this before v1.0. // unreasonable, right? Still, we should revisit this before v1.0.
if (status) { if (status) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
eventStr = String::Empty(node_isolate); eventStr = String::Empty();
} }
else if (events & UV_RENAME) { else if (events & UV_RENAME) {
eventStr = String::New("rename"); eventStr = String::New("rename");
@ -150,10 +150,10 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
} }
Local<Value> argv[3] = { Local<Value> argv[3] = {
Integer::New(status, node_isolate), Integer::New(status),
eventStr, eventStr,
filename ? static_cast<Local<Value> >(String::New(filename)) filename ? static_cast<Local<Value> >(String::New(filename))
: Local<Value>::New(node_isolate, v8::Null(node_isolate)) : Local<Value>::New(v8::Null())
}; };
if (onchange_sym.IsEmpty()) { if (onchange_sym.IsEmpty()) {
@ -172,11 +172,11 @@ Handle<Value> FSEventWrap::Close(const Arguments& args) {
// and legal, HandleWrap::Close() deals with them the same way. // and legal, HandleWrap::Close() deals with them the same way.
assert(!args.Holder().IsEmpty()); assert(!args.Holder().IsEmpty());
assert(args.Holder()->InternalFieldCount() > 0); assert(args.Holder()->InternalFieldCount() > 0);
void* ptr = args.Holder()->GetAlignedPointerFromInternalField(0); void* ptr = args.Holder()->GetPointerFromInternalField(0);
FSEventWrap* wrap = static_cast<FSEventWrap*>(ptr); FSEventWrap* wrap = static_cast<FSEventWrap*>(ptr);
if (wrap == NULL || wrap->initialized_ == false) { if (wrap == NULL || wrap->initialized_ == false) {
return Undefined(node_isolate); return Undefined();
} }
wrap->initialized_ = false; wrap->initialized_ = false;

14
src/handle_wrap.cc

@ -27,7 +27,7 @@
assert(!args.Holder().IsEmpty()); \ assert(!args.Holder().IsEmpty()); \
assert(args.Holder()->InternalFieldCount() > 0); \ assert(args.Holder()->InternalFieldCount() > 0); \
type* wrap = static_cast<type*>( \ type* wrap = static_cast<type*>( \
args.Holder()->GetAlignedPointerFromInternalField(0)); args.Holder()->GetPointerFromInternalField(0));
namespace node { namespace node {
@ -66,7 +66,7 @@ Handle<Value> HandleWrap::Ref(const Arguments& args) {
wrap->unref_ = false; wrap->unref_ = false;
} }
return v8::Undefined(node_isolate); return v8::Undefined();
} }
@ -80,7 +80,7 @@ Handle<Value> HandleWrap::Unref(const Arguments& args) {
wrap->unref_ = true; wrap->unref_ = true;
} }
return v8::Undefined(node_isolate); return v8::Undefined();
} }
@ -88,7 +88,7 @@ Handle<Value> HandleWrap::Close(const Arguments& args) {
HandleScope scope; HandleScope scope;
HandleWrap *wrap = static_cast<HandleWrap*>( HandleWrap *wrap = static_cast<HandleWrap*>(
args.Holder()->GetAlignedPointerFromInternalField(0)); args.Holder()->GetPointerFromInternalField(0));
// guard against uninitialized handle or double close // guard against uninitialized handle or double close
if (wrap && wrap->handle__) { if (wrap && wrap->handle__) {
@ -97,7 +97,7 @@ Handle<Value> HandleWrap::Close(const Arguments& args) {
wrap->handle__ = NULL; wrap->handle__ = NULL;
} }
return v8::Null(node_isolate); return v8::Null();
} }
@ -112,7 +112,7 @@ HandleWrap::HandleWrap(Handle<Object> object, uv_handle_t* h) {
assert(object_.IsEmpty()); assert(object_.IsEmpty());
assert(object->InternalFieldCount() > 0); assert(object->InternalFieldCount() > 0);
object_ = v8::Persistent<v8::Object>::New(object); object_ = v8::Persistent<v8::Object>::New(object);
object_->SetAlignedPointerInInternalField(0, this); object_->SetPointerInInternalField(0, this);
ngx_queue_insert_tail(&handle_wrap_queue, &handle_wrap_queue_); ngx_queue_insert_tail(&handle_wrap_queue, &handle_wrap_queue_);
} }
@ -138,7 +138,7 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
// But the handle pointer should be gone. // But the handle pointer should be gone.
assert(wrap->handle__ == NULL); assert(wrap->handle__ == NULL);
wrap->object_->SetAlignedPointerInInternalField(0, NULL); wrap->object_->SetPointerInInternalField(0, NULL);
wrap->object_.Dispose(); wrap->object_.Dispose();
wrap->object_.Clear(); wrap->object_.Clear();

119
src/node.cc

@ -208,7 +208,7 @@ static void Spin(uv_idle_t* handle, int status) {
static Handle<Value> NeedTickCallback(const Arguments& args) { static Handle<Value> NeedTickCallback(const Arguments& args) {
need_tick_cb = true; need_tick_cb = true;
uv_idle_start(&tick_spinner, Spin); uv_idle_start(&tick_spinner, Spin);
return Undefined(node_isolate); return Undefined();
} }
@ -744,7 +744,7 @@ Local<Value> ErrnoException(int errorno,
Local<Object> obj = e->ToObject(); Local<Object> obj = e->ToObject();
obj->Set(errno_symbol, Integer::New(errorno, node_isolate)); obj->Set(errno_symbol, Integer::New(errorno));
obj->Set(code_symbol, estring); obj->Set(code_symbol, estring);
if (path) obj->Set(errpath_symbol, String::New(path)); if (path) obj->Set(errpath_symbol, String::New(path));
if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall)); if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall));
@ -816,7 +816,7 @@ Local<Value> UVException(int errorno,
Local<Object> obj = e->ToObject(); Local<Object> obj = e->ToObject();
// TODO errno should probably go // TODO errno should probably go
obj->Set(errno_symbol, Integer::New(errorno, node_isolate)); obj->Set(errno_symbol, Integer::New(errorno));
obj->Set(code_symbol, estring); obj->Set(code_symbol, estring);
if (path) obj->Set(errpath_symbol, path_str); if (path) obj->Set(errpath_symbol, path_str);
if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall)); if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall));
@ -877,7 +877,7 @@ Local<Value> WinapiErrnoException(int errorno,
Local<Object> obj = e->ToObject(); Local<Object> obj = e->ToObject();
obj->Set(errno_symbol, Integer::New(errorno, node_isolate)); obj->Set(errno_symbol, Integer::New(errorno));
if (path) obj->Set(errpath_symbol, String::New(path)); if (path) obj->Set(errpath_symbol, String::New(path));
if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall)); if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall));
return e; return e;
@ -930,7 +930,7 @@ MakeDomainCallback(const Handle<Object> object,
assert(!domain.IsEmpty()); assert(!domain.IsEmpty());
if (domain->Get(disposed_symbol)->IsTrue()) { if (domain->Get(disposed_symbol)->IsTrue()) {
// domain has been disposed of. // domain has been disposed of.
return Undefined(node_isolate); return Undefined();
} }
enter = Local<Function>::Cast(domain->Get(enter_symbol)); enter = Local<Function>::Cast(domain->Get(enter_symbol));
assert(!enter.IsEmpty()); assert(!enter.IsEmpty());
@ -938,14 +938,14 @@ MakeDomainCallback(const Handle<Object> object,
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
FatalException(try_catch); FatalException(try_catch);
return Undefined(node_isolate); return Undefined();
} }
Local<Value> ret = callback->Call(object, argc, argv); Local<Value> ret = callback->Call(object, argc, argv);
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
FatalException(try_catch); FatalException(try_catch);
return Undefined(node_isolate); return Undefined();
} }
exit = Local<Function>::Cast(domain->Get(exit_symbol)); exit = Local<Function>::Cast(domain->Get(exit_symbol));
@ -954,7 +954,7 @@ MakeDomainCallback(const Handle<Object> object,
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
FatalException(try_catch); FatalException(try_catch);
return Undefined(node_isolate); return Undefined();
} }
if (tick_infobox.length == 0) { if (tick_infobox.length == 0) {
@ -968,7 +968,7 @@ MakeDomainCallback(const Handle<Object> object,
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
FatalException(try_catch); FatalException(try_catch);
return Undefined(node_isolate); return Undefined();
} }
return ret; return ret;
@ -1008,7 +1008,7 @@ MakeCallback(const Handle<Object> object,
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
FatalException(try_catch); FatalException(try_catch);
return Undefined(node_isolate); return Undefined();
} }
if (tick_infobox.length == 0) { if (tick_infobox.length == 0) {
@ -1022,7 +1022,7 @@ MakeCallback(const Handle<Object> object,
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {
FatalException(try_catch); FatalException(try_catch);
return Undefined(node_isolate); return Undefined();
} }
return scope.Close(ret); return scope.Close(ret);
@ -1115,7 +1115,7 @@ Local<Value> Encode(const void *buf, size_t len, enum encoding encoding) {
Buffer::New(static_cast<const char*>(buf), len)->handle_); Buffer::New(static_cast<const char*>(buf), len)->handle_);
} }
if (!len) return scope.Close(String::Empty(node_isolate)); if (!len) return scope.Close(String::Empty());
if (encoding == BINARY) { if (encoding == BINARY) {
const unsigned char *cbuf = static_cast<const unsigned char*>(buf); const unsigned char *cbuf = static_cast<const unsigned char*>(buf);
@ -1392,7 +1392,7 @@ Handle<Value> GetActiveHandles(const Arguments& args) {
static Handle<Value> Abort(const Arguments& args) { static Handle<Value> Abort(const Arguments& args) {
abort(); abort();
return Undefined(node_isolate); return Undefined();
} }
@ -1411,7 +1411,7 @@ static Handle<Value> Chdir(const Arguments& args) {
return ThrowException(UVException(r.code, "uv_chdir")); return ThrowException(UVException(r.code, "uv_chdir"));
} }
return Undefined(node_isolate); return Undefined();
} }
@ -1581,14 +1581,14 @@ static gid_t gid_by_name(Handle<Value> value) {
static Handle<Value> GetUid(const Arguments& args) { static Handle<Value> GetUid(const Arguments& args) {
HandleScope scope; HandleScope scope;
int uid = getuid(); int uid = getuid();
return scope.Close(Integer::New(uid, node_isolate)); return scope.Close(Integer::New(uid));
} }
static Handle<Value> GetGid(const Arguments& args) { static Handle<Value> GetGid(const Arguments& args) {
HandleScope scope; HandleScope scope;
int gid = getgid(); int gid = getgid();
return scope.Close(Integer::New(gid, node_isolate)); return scope.Close(Integer::New(gid));
} }
@ -1609,7 +1609,7 @@ static Handle<Value> SetGid(const Arguments& args) {
return ThrowException(ErrnoException(errno, "setgid")); return ThrowException(ErrnoException(errno, "setgid"));
} }
return Undefined(node_isolate); return Undefined();
} }
@ -1630,7 +1630,7 @@ static Handle<Value> SetUid(const Arguments& args) {
return ThrowException(ErrnoException(errno, "setuid")); return ThrowException(ErrnoException(errno, "setuid"));
} }
return Undefined(node_isolate); return Undefined();
} }
@ -1657,14 +1657,14 @@ static Handle<Value> GetGroups(const Arguments& args) {
gid_t egid = getegid(); gid_t egid = getegid();
for (int i = 0; i < ngroups; i++) { for (int i = 0; i < ngroups; i++) {
groups_list->Set(i, Integer::New(groups[i], node_isolate)); groups_list->Set(i, Integer::New(groups[i]));
if (groups[i] == egid) seen_egid = true; if (groups[i] == egid) seen_egid = true;
} }
delete[] groups; delete[] groups;
if (seen_egid == false) { if (seen_egid == false) {
groups_list->Set(ngroups, Integer::New(egid, node_isolate)); groups_list->Set(ngroups, Integer::New(egid));
} }
return scope.Close(groups_list); return scope.Close(groups_list);
@ -1700,7 +1700,7 @@ static Handle<Value> SetGroups(const Arguments& args) {
return ThrowException(ErrnoException(errno, "setgroups")); return ThrowException(ErrnoException(errno, "setgroups"));
} }
return Undefined(node_isolate); return Undefined();
} }
@ -1749,7 +1749,7 @@ static Handle<Value> InitGroups(const Arguments& args) {
return ThrowException(ErrnoException(errno, "initgroups")); return ThrowException(ErrnoException(errno, "initgroups"));
} }
return Undefined(node_isolate); return Undefined();
} }
#endif // __POSIX__ #endif // __POSIX__
@ -1758,7 +1758,7 @@ static Handle<Value> InitGroups(const Arguments& args) {
v8::Handle<v8::Value> Exit(const v8::Arguments& args) { v8::Handle<v8::Value> Exit(const v8::Arguments& args) {
HandleScope scope; HandleScope scope;
exit(args[0]->IntegerValue()); exit(args[0]->IntegerValue());
return Undefined(node_isolate); return Undefined();
} }
@ -1769,7 +1769,7 @@ static Handle<Value> Uptime(const Arguments& args) {
uv_err_t err = uv_uptime(&uptime); uv_err_t err = uv_uptime(&uptime);
if (err.code != UV_OK) { if (err.code != UV_OK) {
return Undefined(node_isolate); return Undefined();
} }
return scope.Close(Number::New(uptime - prog_start_time)); return scope.Close(Number::New(uptime - prog_start_time));
@ -1801,11 +1801,9 @@ v8::Handle<v8::Value> MemoryUsage(const v8::Arguments& args) {
HeapStatistics v8_heap_stats; HeapStatistics v8_heap_stats;
V8::GetHeapStatistics(&v8_heap_stats); V8::GetHeapStatistics(&v8_heap_stats);
info->Set(heap_total_symbol, info->Set(heap_total_symbol,
Integer::NewFromUnsigned(v8_heap_stats.total_heap_size(), Integer::NewFromUnsigned(v8_heap_stats.total_heap_size()));
node_isolate));
info->Set(heap_used_symbol, info->Set(heap_used_symbol,
Integer::NewFromUnsigned(v8_heap_stats.used_heap_size(), Integer::NewFromUnsigned(v8_heap_stats.used_heap_size()));
node_isolate));
return scope.Close(info); return scope.Close(info);
} }
@ -1824,10 +1822,10 @@ Handle<Value> Kill(const Arguments& args) {
if (err.code != UV_OK) { if (err.code != UV_OK) {
SetErrno(err); SetErrno(err);
return scope.Close(Integer::New(-1, node_isolate)); return scope.Close(Integer::New(-1));
} }
return Undefined(node_isolate); return Undefined();
} }
// used in Hrtime() below // used in Hrtime() below
@ -1857,8 +1855,8 @@ Handle<Value> Hrtime(const v8::Arguments& args) {
} }
Local<Array> tuple = Array::New(2); Local<Array> tuple = Array::New(2);
tuple->Set(0, Integer::NewFromUnsigned(t / NANOS_PER_SEC, node_isolate)); tuple->Set(0, Integer::NewFromUnsigned(t / NANOS_PER_SEC));
tuple->Set(1, Integer::NewFromUnsigned(t % NANOS_PER_SEC, node_isolate)); tuple->Set(1, Integer::NewFromUnsigned(t % NANOS_PER_SEC));
return scope.Close(tuple); return scope.Close(tuple);
} }
@ -1958,7 +1956,7 @@ Handle<Value> DLOpen(const v8::Arguments& args) {
// Tell coverity that 'handle' should not be freed when we return. // Tell coverity that 'handle' should not be freed when we return.
// coverity[leaked_storage] // coverity[leaked_storage]
return Undefined(node_isolate); return Undefined();
} }
@ -2137,7 +2135,7 @@ static Handle<Integer> EnvQuery(Local<String> property,
#ifdef __POSIX__ #ifdef __POSIX__
String::Utf8Value key(property); String::Utf8Value key(property);
if (getenv(*key)) { if (getenv(*key)) {
return scope.Close(Integer::New(0, node_isolate)); return scope.Close(Integer::New(0));
} }
#else // _WIN32 #else // _WIN32
String::Value key(property); String::Value key(property);
@ -2148,10 +2146,9 @@ static Handle<Integer> EnvQuery(Local<String> property,
// Environment variables that start with '=' are hidden and read-only. // Environment variables that start with '=' are hidden and read-only.
return scope.Close(Integer::New(v8::ReadOnly || return scope.Close(Integer::New(v8::ReadOnly ||
v8::DontDelete || v8::DontDelete ||
v8::DontEnum, v8::DontEnum));
node_isolate));
} else { } else {
return scope.Close(Integer::New(0, node_isolate)); return scope.Close(Integer::New(0));
} }
} }
#endif #endif
@ -2165,9 +2162,9 @@ static Handle<Boolean> EnvDeleter(Local<String> property,
HandleScope scope; HandleScope scope;
#ifdef __POSIX__ #ifdef __POSIX__
String::Utf8Value key(property); String::Utf8Value key(property);
if (!getenv(*key)) return False(node_isolate); if (!getenv(*key)) return False();
unsetenv(*key); // can't check return value, it's void on some platforms unsetenv(*key); // can't check return value, it's void on some platforms
return True(node_isolate); return True();
#else #else
String::Value key(property); String::Value key(property);
WCHAR* key_ptr = reinterpret_cast<WCHAR*>(*key); WCHAR* key_ptr = reinterpret_cast<WCHAR*>(*key);
@ -2178,7 +2175,7 @@ static Handle<Boolean> EnvDeleter(Local<String> property,
GetLastError() != ERROR_SUCCESS; GetLastError() != ERROR_SUCCESS;
return scope.Close(Boolean::New(rv)); return scope.Close(Boolean::New(rv));
} }
return True(node_isolate); return True();
#endif #endif
} }
@ -2233,14 +2230,14 @@ static Handle<Object> GetFeatures() {
Local<Object> obj = Object::New(); Local<Object> obj = Object::New();
obj->Set(String::NewSymbol("debug"), obj->Set(String::NewSymbol("debug"),
#if defined(DEBUG) && DEBUG #if defined(DEBUG) && DEBUG
True(node_isolate) True()
#else #else
False(node_isolate) False()
#endif #endif
); );
obj->Set(String::NewSymbol("uv"), True(node_isolate)); obj->Set(String::NewSymbol("uv"), True());
obj->Set(String::NewSymbol("ipv6"), True(node_isolate)); // TODO ping libuv obj->Set(String::NewSymbol("ipv6"), True()); // TODO ping libuv
obj->Set(String::NewSymbol("tls_npn"), Boolean::New(use_npn)); obj->Set(String::NewSymbol("tls_npn"), Boolean::New(use_npn));
obj->Set(String::NewSymbol("tls_sni"), Boolean::New(use_sni)); obj->Set(String::NewSymbol("tls_sni"), Boolean::New(use_sni));
obj->Set(String::NewSymbol("tls"), obj->Set(String::NewSymbol("tls"),
@ -2253,7 +2250,7 @@ static Handle<Object> GetFeatures() {
static Handle<Value> DebugPortGetter(Local<String> property, static Handle<Value> DebugPortGetter(Local<String> property,
const AccessorInfo& info) { const AccessorInfo& info) {
HandleScope scope; HandleScope scope;
return scope.Close(Integer::NewFromUnsigned(debug_port, node_isolate)); return scope.Close(Integer::NewFromUnsigned(debug_port));
} }
@ -2361,10 +2358,10 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
// process.argv // process.argv
Local<Array> arguments = Array::New(argc - option_end_index + 1); Local<Array> arguments = Array::New(argc - option_end_index + 1);
arguments->Set(Integer::New(0, node_isolate), String::New(argv[0])); arguments->Set(Integer::New(0), String::New(argv[0]));
for (j = 1, i = option_end_index; i < argc; j++, i++) { for (j = 1, i = option_end_index; i < argc; j++, i++) {
Local<String> arg = String::New(argv[i]); Local<String> arg = String::New(argv[i]);
arguments->Set(Integer::New(j, node_isolate), arg); arguments->Set(Integer::New(j), arg);
} }
// assign it // assign it
process->Set(String::NewSymbol("argv"), arguments); process->Set(String::NewSymbol("argv"), arguments);
@ -2372,7 +2369,7 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
// process.execArgv // process.execArgv
Local<Array> execArgv = Array::New(option_end_index - 1); Local<Array> execArgv = Array::New(option_end_index - 1);
for (j = 1, i = 0; j < option_end_index; j++, i++) { for (j = 1, i = 0; j < option_end_index; j++, i++) {
execArgv->Set(Integer::New(i, node_isolate), String::New(argv[j])); execArgv->Set(Integer::New(i), String::New(argv[j]));
} }
// assign it // assign it
process->Set(String::NewSymbol("execArgv"), execArgv); process->Set(String::NewSymbol("execArgv"), execArgv);
@ -2389,7 +2386,7 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
Local<Object> env = envTemplate->NewInstance(); Local<Object> env = envTemplate->NewInstance();
process->Set(String::NewSymbol("env"), env); process->Set(String::NewSymbol("env"), env);
process->Set(String::NewSymbol("pid"), Integer::New(getpid(), node_isolate)); process->Set(String::NewSymbol("pid"), Integer::New(getpid()));
process->Set(String::NewSymbol("features"), GetFeatures()); process->Set(String::NewSymbol("features"), GetFeatures());
process->SetAccessor(String::New("_needImmediateCallback"), process->SetAccessor(String::New("_needImmediateCallback"),
NeedImmediateCallbackGetter, NeedImmediateCallbackGetter,
@ -2402,22 +2399,22 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
// -p, --print // -p, --print
if (print_eval) { if (print_eval) {
process->Set(String::NewSymbol("_print_eval"), True(node_isolate)); process->Set(String::NewSymbol("_print_eval"), True());
} }
// -i, --interactive // -i, --interactive
if (force_repl) { if (force_repl) {
process->Set(String::NewSymbol("_forceRepl"), True(node_isolate)); process->Set(String::NewSymbol("_forceRepl"), True());
} }
// --no-deprecation // --no-deprecation
if (no_deprecation) { if (no_deprecation) {
process->Set(String::NewSymbol("noDeprecation"), True(node_isolate)); process->Set(String::NewSymbol("noDeprecation"), True());
} }
// --trace-deprecation // --trace-deprecation
if (trace_deprecation) { if (trace_deprecation) {
process->Set(String::NewSymbol("traceDeprecation"), True(node_isolate)); process->Set(String::NewSymbol("traceDeprecation"), True());
} }
size_t size = 2*PATH_MAX; size_t size = 2*PATH_MAX;
@ -2527,7 +2524,7 @@ void Load(Handle<Object> process_l) {
// Add a reference to the global object // Add a reference to the global object
Local<Object> global = v8::Context::GetCurrent()->Global(); Local<Object> global = v8::Context::GetCurrent()->Global();
Local<Value> args[1] = { Local<Value>::New(node_isolate, process_l) }; Local<Value> args[1] = { Local<Value>::New(process_l) };
#if defined HAVE_DTRACE || defined HAVE_ETW || defined HAVE_SYSTEMTAP #if defined HAVE_DTRACE || defined HAVE_ETW || defined HAVE_SYSTEMTAP
InitDTrace(global); InitDTrace(global);
@ -2756,7 +2753,7 @@ Handle<Value> DebugProcess(const Arguments& args) {
return ThrowException(ErrnoException(errno, "kill")); return ThrowException(ErrnoException(errno, "kill"));
} }
return Undefined(node_isolate); return Undefined();
} }
#endif // __POSIX__ #endif // __POSIX__
@ -2829,7 +2826,7 @@ static int RegisterDebugSignalHandler() {
static Handle<Value> DebugProcess(const Arguments& args) { static Handle<Value> DebugProcess(const Arguments& args) {
HandleScope scope; HandleScope scope;
Handle<Value> rv = Undefined(node_isolate); Handle<Value> rv = Undefined();
DWORD pid; DWORD pid;
HANDLE process = NULL; HANDLE process = NULL;
HANDLE thread = NULL; HANDLE thread = NULL;
@ -2913,14 +2910,14 @@ static Handle<Value> DebugProcess(const Arguments& args) {
CloseHandle(mapping); CloseHandle(mapping);
} }
return Undefined(node_isolate); return Undefined();
} }
#endif // _WIN32 #endif // _WIN32
static Handle<Value> DebugPause(const Arguments& args) { static Handle<Value> DebugPause(const Arguments& args) {
v8::Debug::DebugBreak(node_isolate); v8::Debug::DebugBreak(node_isolate);
return Undefined(node_isolate); return Undefined();
} }
@ -2930,7 +2927,7 @@ static Handle<Value> DebugEnd(const Arguments& args) {
debugger_running = false; debugger_running = false;
} }
return Undefined(node_isolate); return Undefined();
} }
@ -3041,11 +3038,11 @@ void AtExit(void (*cb)(void* arg), void* arg) {
void EmitExit(v8::Handle<v8::Object> process_l) { void EmitExit(v8::Handle<v8::Object> process_l) {
// process.emit('exit') // process.emit('exit')
process_l->Set(String::NewSymbol("_exiting"), True(node_isolate)); process_l->Set(String::NewSymbol("_exiting"), True());
Local<Value> emit_v = process_l->Get(String::New("emit")); Local<Value> emit_v = process_l->Get(String::New("emit"));
assert(emit_v->IsFunction()); assert(emit_v->IsFunction());
Local<Function> emit = Local<Function>::Cast(emit_v); Local<Function> emit = Local<Function>::Cast(emit_v);
Local<Value> args[] = { String::New("exit"), Integer::New(0, node_isolate) }; Local<Value> args[] = { String::New("exit"), Integer::New(0) };
TryCatch try_catch; TryCatch try_catch;
emit->Call(process_l, 2, args); emit->Call(process_l, 2, args);
if (try_catch.HasCaught()) { if (try_catch.HasCaught()) {

58
src/node_buffer.cc

@ -117,7 +117,7 @@ Handle<Object> Buffer::New(Handle<String> string) {
assert(bv->IsFunction()); assert(bv->IsFunction());
Local<Function> b = Local<Function>::Cast(bv); Local<Function> b = Local<Function>::Cast(bv);
Local<Value> argv[1] = { Local<Value>::New(node_isolate, string) }; Local<Value> argv[1] = { Local<Value>::New(string) };
Local<Object> instance = b->NewInstance(1, argv); Local<Object> instance = b->NewInstance(1, argv);
return scope.Close(instance); return scope.Close(instance);
@ -127,7 +127,7 @@ Handle<Object> Buffer::New(Handle<String> string) {
Buffer* Buffer::New(size_t length) { Buffer* Buffer::New(size_t length) {
HandleScope scope; HandleScope scope;
Local<Value> arg = Integer::NewFromUnsigned(length, node_isolate); Local<Value> arg = Integer::NewFromUnsigned(length);
Local<Object> b = constructor_template->GetFunction()->NewInstance(1, &arg); Local<Object> b = constructor_template->GetFunction()->NewInstance(1, &arg);
if (b.IsEmpty()) return NULL; if (b.IsEmpty()) return NULL;
@ -138,7 +138,7 @@ Buffer* Buffer::New(size_t length) {
Buffer* Buffer::New(const char* data, size_t length) { Buffer* Buffer::New(const char* data, size_t length) {
HandleScope scope; HandleScope scope;
Local<Value> arg = Integer::NewFromUnsigned(0, node_isolate); Local<Value> arg = Integer::NewFromUnsigned(0);
Local<Object> obj = constructor_template->GetFunction()->NewInstance(1, &arg); Local<Object> obj = constructor_template->GetFunction()->NewInstance(1, &arg);
Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj); Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj);
@ -152,7 +152,7 @@ Buffer* Buffer::New(char *data, size_t length,
free_callback callback, void *hint) { free_callback callback, void *hint) {
HandleScope scope; HandleScope scope;
Local<Value> arg = Integer::NewFromUnsigned(0, node_isolate); Local<Value> arg = Integer::NewFromUnsigned(0);
Local<Object> obj = constructor_template->GetFunction()->NewInstance(1, &arg); Local<Object> obj = constructor_template->GetFunction()->NewInstance(1, &arg);
Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj); Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj);
@ -229,7 +229,7 @@ void Buffer::Replace(char *data, size_t length,
handle_->SetIndexedPropertiesToExternalArrayData(data_, handle_->SetIndexedPropertiesToExternalArrayData(data_,
kExternalUnsignedByteArray, kExternalUnsignedByteArray,
length_); length_);
handle_->Set(length_symbol, Integer::NewFromUnsigned(length_, node_isolate)); handle_->Set(length_symbol, Integer::NewFromUnsigned(length_));
} }
@ -284,7 +284,7 @@ Handle<Value> Buffer::HexSlice(const Arguments &args) {
SLICE_ARGS(args[0], args[1]) SLICE_ARGS(args[0], args[1])
char* src = parent->data_ + start; char* src = parent->data_ + start;
uint32_t dstlen = (end - start) * 2; uint32_t dstlen = (end - start) * 2;
if (dstlen == 0) return scope.Close(String::Empty(node_isolate)); if (dstlen == 0) return scope.Close(String::Empty());
char* dst = new char[dstlen]; char* dst = new char[dstlen];
for (uint32_t i = 0, k = 0; k < dstlen; i += 1, k += 2) { for (uint32_t i = 0, k = 0; k < dstlen; i += 1, k += 2) {
static const char hex[] = "0123456789abcdef"; static const char hex[] = "0123456789abcdef";
@ -405,7 +405,7 @@ Handle<Value> Buffer::Fill(const Arguments &args) {
value, value,
end - start); end - start);
return Undefined(node_isolate); return Undefined();
} }
@ -433,7 +433,7 @@ Handle<Value> Buffer::Copy(const Arguments &args) {
// Copy 0 bytes; we're done // Copy 0 bytes; we're done
if (source_end == source_start) { if (source_end == source_start) {
return scope.Close(Integer::New(0, node_isolate)); return scope.Close(Integer::New(0));
} }
if (target_start >= target_length) { if (target_start >= target_length) {
@ -457,7 +457,7 @@ Handle<Value> Buffer::Copy(const Arguments &args) {
(const void*)(source->data_ + source_start), (const void*)(source->data_ + source_start),
to_copy); to_copy);
return scope.Close(Integer::New(to_copy, node_isolate)); return scope.Close(Integer::New(to_copy));
} }
@ -479,8 +479,8 @@ Handle<Value> Buffer::Utf8Write(const Arguments &args) {
if (length == 0) { if (length == 0) {
constructor_template->GetFunction()->Set(chars_written_sym, constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(0, node_isolate)); Integer::New(0));
return scope.Close(Integer::New(0, node_isolate)); return scope.Close(Integer::New(0));
} }
if (length > 0 && offset >= buffer->length_) { if (length > 0 && offset >= buffer->length_) {
@ -502,10 +502,9 @@ Handle<Value> Buffer::Utf8Write(const Arguments &args) {
String::NO_NULL_TERMINATION)); String::NO_NULL_TERMINATION));
constructor_template->GetFunction()->Set(chars_written_sym, constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(char_written, Integer::New(char_written));
node_isolate));
return scope.Close(Integer::New(written, node_isolate)); return scope.Close(Integer::New(written));
} }
@ -540,9 +539,9 @@ Handle<Value> Buffer::Ucs2Write(const Arguments &args) {
String::NO_NULL_TERMINATION)); String::NO_NULL_TERMINATION));
constructor_template->GetFunction()->Set(chars_written_sym, constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(written, node_isolate)); Integer::New(written));
return scope.Close(Integer::New(written * 2, node_isolate)); return scope.Close(Integer::New(written * 2));
} }
@ -573,7 +572,7 @@ Handle<Value> Buffer::HexWrite(const Arguments& args) {
uint32_t end = start + size; uint32_t end = start + size;
if (start >= parent->length_) { if (start >= parent->length_) {
Local<Integer> val = Integer::New(0, node_isolate); Local<Integer> val = Integer::New(0);
constructor_template->GetFunction()->Set(chars_written_sym, val); constructor_template->GetFunction()->Set(chars_written_sym, val);
return scope.Close(val); return scope.Close(val);
} }
@ -584,7 +583,7 @@ Handle<Value> Buffer::HexWrite(const Arguments& args) {
} }
if (size == 0) { if (size == 0) {
Local<Integer> val = Integer::New(0, node_isolate); Local<Integer> val = Integer::New(0);
constructor_template->GetFunction()->Set(chars_written_sym, val); constructor_template->GetFunction()->Set(chars_written_sym, val);
return scope.Close(val); return scope.Close(val);
} }
@ -606,9 +605,9 @@ Handle<Value> Buffer::HexWrite(const Arguments& args) {
} }
constructor_template->GetFunction()->Set(chars_written_sym, constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(max * 2, node_isolate)); Integer::New(max * 2));
return scope.Close(Integer::New(max, node_isolate)); return scope.Close(Integer::New(max));
} }
@ -643,9 +642,9 @@ Handle<Value> Buffer::AsciiWrite(const Arguments &args) {
String::NO_NULL_TERMINATION)); String::NO_NULL_TERMINATION));
constructor_template->GetFunction()->Set(chars_written_sym, constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(written, node_isolate)); Integer::New(written));
return scope.Close(Integer::New(written, node_isolate)); return scope.Close(Integer::New(written));
} }
@ -706,10 +705,9 @@ Handle<Value> Buffer::Base64Write(const Arguments &args) {
} }
constructor_template->GetFunction()->Set(chars_written_sym, constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(dst - start, Integer::New(dst - start));
node_isolate));
return scope.Close(Integer::New(dst - start, node_isolate)); return scope.Close(Integer::New(dst - start));
} }
@ -739,9 +737,9 @@ Handle<Value> Buffer::BinaryWrite(const Arguments &args) {
int written = DecodeWrite(p, max_length, s, BINARY); int written = DecodeWrite(p, max_length, s, BINARY);
constructor_template->GetFunction()->Set(chars_written_sym, constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(written, node_isolate)); Integer::New(written));
return scope.Close(Integer::New(written, node_isolate)); return scope.Close(Integer::New(written));
} }
@ -838,7 +836,7 @@ Handle<Value> WriteFloatGeneric(const Arguments& args) {
if (ENDIANNESS != is_big_endian()) if (ENDIANNESS != is_big_endian())
swizzle(ptr, sizeof(T)); swizzle(ptr, sizeof(T));
return Undefined(node_isolate); return Undefined();
} }
@ -873,7 +871,7 @@ Handle<Value> Buffer::ByteLength(const Arguments &args) {
Local<String> s = args[0]->ToString(); Local<String> s = args[0]->ToString();
enum encoding e = ParseEncoding(args[1], UTF8); enum encoding e = ParseEncoding(args[1], UTF8);
return scope.Close(Integer::New(node::ByteLength(s, e), node_isolate)); return scope.Close(Integer::New(node::ByteLength(s, e)));
} }
@ -906,7 +904,7 @@ Handle<Value> Buffer::MakeFastBuffer(const Arguments &args) {
kExternalUnsignedByteArray, kExternalUnsignedByteArray,
length); length);
return Undefined(node_isolate); return Undefined();
} }

12
src/node_counters.cc

@ -44,37 +44,37 @@ static uint64_t counter_gc_end_time;
Handle<Value> COUNTER_NET_SERVER_CONNECTION(const Arguments& args) { Handle<Value> COUNTER_NET_SERVER_CONNECTION(const Arguments& args) {
NODE_COUNT_SERVER_CONN_OPEN(); NODE_COUNT_SERVER_CONN_OPEN();
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> COUNTER_NET_SERVER_CONNECTION_CLOSE(const Arguments& args) { Handle<Value> COUNTER_NET_SERVER_CONNECTION_CLOSE(const Arguments& args) {
NODE_COUNT_SERVER_CONN_CLOSE(); NODE_COUNT_SERVER_CONN_CLOSE();
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> COUNTER_HTTP_SERVER_REQUEST(const Arguments& args) { Handle<Value> COUNTER_HTTP_SERVER_REQUEST(const Arguments& args) {
NODE_COUNT_HTTP_SERVER_REQUEST(); NODE_COUNT_HTTP_SERVER_REQUEST();
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> COUNTER_HTTP_SERVER_RESPONSE(const Arguments& args) { Handle<Value> COUNTER_HTTP_SERVER_RESPONSE(const Arguments& args) {
NODE_COUNT_HTTP_SERVER_RESPONSE(); NODE_COUNT_HTTP_SERVER_RESPONSE();
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> COUNTER_HTTP_CLIENT_REQUEST(const Arguments& args) { Handle<Value> COUNTER_HTTP_CLIENT_REQUEST(const Arguments& args) {
NODE_COUNT_HTTP_CLIENT_REQUEST(); NODE_COUNT_HTTP_CLIENT_REQUEST();
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> COUNTER_HTTP_CLIENT_RESPONSE(const Arguments& args) { Handle<Value> COUNTER_HTTP_CLIENT_RESPONSE(const Arguments& args) {
NODE_COUNT_HTTP_CLIENT_RESPONSE(); NODE_COUNT_HTTP_CLIENT_RESPONSE();
return Undefined(node_isolate); return Undefined();
} }

137
src/node_crypto.cc

@ -233,7 +233,7 @@ Handle<Value> SecureContext::Init(const Arguments& args) {
SSL_CTX_sess_set_new_cb(sc->ctx_, NewSessionCallback); SSL_CTX_sess_set_new_cb(sc->ctx_, NewSessionCallback);
sc->ca_store_ = NULL; sc->ca_store_ = NULL;
return True(node_isolate); return True();
} }
@ -349,7 +349,7 @@ Handle<Value> SecureContext::SetKey(const Arguments& args) {
} }
BIO *bio = LoadBIO(args[0]); BIO *bio = LoadBIO(args[0]);
if (!bio) return False(node_isolate); if (!bio) return False();
String::Utf8Value passphrase(args[1]); String::Utf8Value passphrase(args[1]);
@ -370,7 +370,7 @@ Handle<Value> SecureContext::SetKey(const Arguments& args) {
EVP_PKEY_free(key); EVP_PKEY_free(key);
BIO_free(bio); BIO_free(bio);
return True(node_isolate); return True();
} }
@ -451,7 +451,7 @@ Handle<Value> SecureContext::SetCert(const Arguments& args) {
} }
BIO* bio = LoadBIO(args[0]); BIO* bio = LoadBIO(args[0]);
if (!bio) return False(node_isolate); if (!bio) return False();
int rv = SSL_CTX_use_certificate_chain(sc->ctx_, bio); int rv = SSL_CTX_use_certificate_chain(sc->ctx_, bio);
@ -466,7 +466,7 @@ Handle<Value> SecureContext::SetCert(const Arguments& args) {
return ThrowCryptoError(err); return ThrowCryptoError(err);
} }
return True(node_isolate); return True();
} }
@ -486,7 +486,7 @@ Handle<Value> SecureContext::AddCACert(const Arguments& args) {
} }
X509* x509 = LoadX509(args[0]); X509* x509 = LoadX509(args[0]);
if (!x509) return False(node_isolate); if (!x509) return False();
X509_STORE_add_cert(sc->ca_store_, x509); X509_STORE_add_cert(sc->ca_store_, x509);
SSL_CTX_add_client_CA(sc->ctx_, x509); SSL_CTX_add_client_CA(sc->ctx_, x509);
@ -497,7 +497,7 @@ Handle<Value> SecureContext::AddCACert(const Arguments& args) {
SSL_CTX_set_cert_store(sc->ctx_, sc->ca_store_); SSL_CTX_set_cert_store(sc->ctx_, sc->ca_store_);
} }
return True(node_isolate); return True();
} }
@ -511,13 +511,13 @@ Handle<Value> SecureContext::AddCRL(const Arguments& args) {
} }
BIO *bio = LoadBIO(args[0]); BIO *bio = LoadBIO(args[0]);
if (!bio) return False(node_isolate); if (!bio) return False();
X509_CRL *x509 = PEM_read_bio_X509_CRL(bio, NULL, NULL, NULL); X509_CRL *x509 = PEM_read_bio_X509_CRL(bio, NULL, NULL, NULL);
if (x509 == NULL) { if (x509 == NULL) {
BIO_free(bio); BIO_free(bio);
return False(node_isolate); return False();
} }
X509_STORE_add_crl(sc->ca_store_, x509); X509_STORE_add_crl(sc->ca_store_, x509);
@ -528,7 +528,7 @@ Handle<Value> SecureContext::AddCRL(const Arguments& args) {
BIO_free(bio); BIO_free(bio);
X509_CRL_free(x509); X509_CRL_free(x509);
return True(node_isolate); return True();
} }
@ -548,14 +548,14 @@ Handle<Value> SecureContext::AddRootCerts(const Arguments& args) {
if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) { if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) {
BIO_free(bp); BIO_free(bp);
return False(node_isolate); return False();
} }
X509 *x509 = PEM_read_bio_X509(bp, NULL, NULL, NULL); X509 *x509 = PEM_read_bio_X509(bp, NULL, NULL, NULL);
if (x509 == NULL) { if (x509 == NULL) {
BIO_free(bp); BIO_free(bp);
return False(node_isolate); return False();
} }
X509_STORE_add_cert(root_cert_store, x509); X509_STORE_add_cert(root_cert_store, x509);
@ -568,7 +568,7 @@ Handle<Value> SecureContext::AddRootCerts(const Arguments& args) {
sc->ca_store_ = root_cert_store; sc->ca_store_ = root_cert_store;
SSL_CTX_set_cert_store(sc->ctx_, sc->ca_store_); SSL_CTX_set_cert_store(sc->ctx_, sc->ca_store_);
return True(node_isolate); return True();
} }
@ -584,7 +584,7 @@ Handle<Value> SecureContext::SetCiphers(const Arguments& args) {
String::Utf8Value ciphers(args[0]); String::Utf8Value ciphers(args[0]);
SSL_CTX_set_cipher_list(sc->ctx_, *ciphers); SSL_CTX_set_cipher_list(sc->ctx_, *ciphers);
return True(node_isolate); return True();
} }
Handle<Value> SecureContext::SetOptions(const Arguments& args) { Handle<Value> SecureContext::SetOptions(const Arguments& args) {
@ -598,7 +598,7 @@ Handle<Value> SecureContext::SetOptions(const Arguments& args) {
SSL_CTX_set_options(sc->ctx_, args[0]->IntegerValue()); SSL_CTX_set_options(sc->ctx_, args[0]->IntegerValue());
return True(node_isolate); return True();
} }
Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) { Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) {
@ -630,14 +630,14 @@ Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) {
return ThrowException(Exception::TypeError(message)); return ThrowException(Exception::TypeError(message));
} }
return True(node_isolate); return True();
} }
Handle<Value> SecureContext::Close(const Arguments& args) { Handle<Value> SecureContext::Close(const Arguments& args) {
HandleScope scope; HandleScope scope;
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder()); SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder());
sc->FreeCTXMem(); sc->FreeCTXMem();
return False(node_isolate); return False();
} }
//Takes .pfx or .p12 and password in string or buffer format //Takes .pfx or .p12 and password in string or buffer format
@ -714,7 +714,7 @@ Handle<Value> SecureContext::LoadPKCS12(const Arguments& args) {
return ThrowException(Exception::Error(String::New(str))); return ThrowException(Exception::Error(String::New(str)));
} }
return True(node_isolate); return True();
} }
@ -960,11 +960,11 @@ void Connection::SetShutdownFlags() {
int flags = SSL_get_shutdown(ssl_); int flags = SSL_get_shutdown(ssl_);
if (flags & SSL_SENT_SHUTDOWN) { if (flags & SSL_SENT_SHUTDOWN) {
handle_->Set(String::New("sentShutdown"), True(node_isolate)); handle_->Set(String::New("sentShutdown"), True());
} }
if (flags & SSL_RECEIVED_SHUTDOWN) { if (flags & SSL_RECEIVED_SHUTDOWN) {
handle_->Set(String::New("receivedShutdown"), True(node_isolate)); handle_->Set(String::New("receivedShutdown"), True());
} }
} }
@ -1094,7 +1094,7 @@ int Connection::SelectNextProtoCallback_(SSL *s,
*outlen = 8; *outlen = 8;
// set status unsupported // set status unsupported
p->selectedNPNProto_ = Persistent<Value>::New(False(node_isolate)); p->selectedNPNProto_ = Persistent<Value>::New(False());
return SSL_TLSEXT_ERR_OK; return SSL_TLSEXT_ERR_OK;
} }
@ -1107,7 +1107,7 @@ int Connection::SelectNextProtoCallback_(SSL *s,
switch (status) { switch (status) {
case OPENSSL_NPN_UNSUPPORTED: case OPENSSL_NPN_UNSUPPORTED:
p->selectedNPNProto_ = Persistent<Value>::New(Null(node_isolate)); p->selectedNPNProto_ = Persistent<Value>::New(Null());
break; break;
case OPENSSL_NPN_NEGOTIATED: case OPENSSL_NPN_NEGOTIATED:
p->selectedNPNProto_ = Persistent<Value>::New(String::New( p->selectedNPNProto_ = Persistent<Value>::New(String::New(
@ -1115,7 +1115,7 @@ int Connection::SelectNextProtoCallback_(SSL *s,
)); ));
break; break;
case OPENSSL_NPN_NO_OVERLAP: case OPENSSL_NPN_NO_OVERLAP:
p->selectedNPNProto_ = Persistent<Value>::New(False(node_isolate)); p->selectedNPNProto_ = Persistent<Value>::New(False());
break; break;
default: default:
break; break;
@ -1149,8 +1149,7 @@ int Connection::SelectSNIContextCallback_(SSL *s, int *ad, void* arg) {
Local<Value> argv[1] = {*p->servername_}; Local<Value> argv[1] = {*p->servername_};
// Call it // Call it
Local<Value> ret = Local<Value>::New(node_isolate, Local<Value> ret = Local<Value>::New(MakeCallback(p->sniObject_,
MakeCallback(p->sniObject_,
"onselect", "onselect",
ARRAY_SIZE(argv), ARRAY_SIZE(argv),
argv)); argv));
@ -1321,7 +1320,7 @@ Handle<Value> Connection::EncIn(const Arguments& args) {
ss->SetShutdownFlags(); ss->SetShutdownFlags();
} }
return scope.Close(Integer::New(bytes_written, node_isolate)); return scope.Close(Integer::New(bytes_written));
} }
@ -1366,14 +1365,14 @@ Handle<Value> Connection::ClearOut(const Arguments& args) {
ss->HandleSSLError("SSL_connect:ClearOut", rv, kZeroIsAnError); ss->HandleSSLError("SSL_connect:ClearOut", rv, kZeroIsAnError);
} }
if (rv < 0) return scope.Close(Integer::New(rv, node_isolate)); if (rv < 0) return scope.Close(Integer::New(rv));
} }
int bytes_read = SSL_read(ss->ssl_, buffer_data + off, len); int bytes_read = SSL_read(ss->ssl_, buffer_data + off, len);
ss->HandleSSLError("SSL_read:ClearOut", bytes_read, kZeroIsNotAnError); ss->HandleSSLError("SSL_read:ClearOut", bytes_read, kZeroIsNotAnError);
ss->SetShutdownFlags(); ss->SetShutdownFlags();
return scope.Close(Integer::New(bytes_read, node_isolate)); return scope.Close(Integer::New(bytes_read));
} }
@ -1383,7 +1382,7 @@ Handle<Value> Connection::ClearPending(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
int bytes_pending = BIO_pending(ss->bio_read_); int bytes_pending = BIO_pending(ss->bio_read_);
return scope.Close(Integer::New(bytes_pending, node_isolate)); return scope.Close(Integer::New(bytes_pending));
} }
@ -1393,7 +1392,7 @@ Handle<Value> Connection::EncPending(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
int bytes_pending = BIO_pending(ss->bio_write_); int bytes_pending = BIO_pending(ss->bio_write_);
return scope.Close(Integer::New(bytes_pending, node_isolate)); return scope.Close(Integer::New(bytes_pending));
} }
@ -1432,7 +1431,7 @@ Handle<Value> Connection::EncOut(const Arguments& args) {
ss->HandleBIOError(ss->bio_write_, "BIO_read:EncOut", bytes_read); ss->HandleBIOError(ss->bio_write_, "BIO_read:EncOut", bytes_read);
ss->SetShutdownFlags(); ss->SetShutdownFlags();
return scope.Close(Integer::New(bytes_read, node_isolate)); return scope.Close(Integer::New(bytes_read));
} }
@ -1476,7 +1475,7 @@ Handle<Value> Connection::ClearIn(const Arguments& args) {
ss->HandleSSLError("SSL_connect:ClearIn", rv, kZeroIsAnError); ss->HandleSSLError("SSL_connect:ClearIn", rv, kZeroIsAnError);
} }
if (rv < 0) return scope.Close(Integer::New(rv, node_isolate)); if (rv < 0) return scope.Close(Integer::New(rv));
} }
int bytes_written = SSL_write(ss->ssl_, buffer_data + off, len); int bytes_written = SSL_write(ss->ssl_, buffer_data + off, len);
@ -1484,7 +1483,7 @@ Handle<Value> Connection::ClearIn(const Arguments& args) {
ss->HandleSSLError("SSL_write:ClearIn", bytes_written, kZeroIsAnError); ss->HandleSSLError("SSL_write:ClearIn", bytes_written, kZeroIsAnError);
ss->SetShutdownFlags(); ss->SetShutdownFlags();
return scope.Close(Integer::New(bytes_written, node_isolate)); return scope.Close(Integer::New(bytes_written));
} }
@ -1493,7 +1492,7 @@ Handle<Value> Connection::GetPeerCertificate(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
if (ss->ssl_ == NULL) return Undefined(node_isolate); if (ss->ssl_ == NULL) return Undefined();
Local<Object> info = Object::New(); Local<Object> info = Object::New();
X509* peer_cert = SSL_get_peer_certificate(ss->ssl_); X509* peer_cert = SSL_get_peer_certificate(ss->ssl_);
if (peer_cert != NULL) { if (peer_cert != NULL) {
@ -1595,7 +1594,7 @@ Handle<Value> Connection::GetPeerCertificate(const Arguments& args) {
for (int i = 0; i < sk_ASN1_OBJECT_num(eku); i++) { for (int i = 0; i < sk_ASN1_OBJECT_num(eku); i++) {
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
OBJ_obj2txt(buf, sizeof(buf) - 1, sk_ASN1_OBJECT_value(eku, i), 1); OBJ_obj2txt(buf, sizeof(buf) - 1, sk_ASN1_OBJECT_value(eku, i), 1);
ext_key_usage->Set(Integer::New(i, node_isolate), String::New(buf)); ext_key_usage->Set(Integer::New(i), String::New(buf));
} }
sk_ASN1_OBJECT_pop_free(eku, ASN1_OBJECT_free); sk_ASN1_OBJECT_pop_free(eku, ASN1_OBJECT_free);
@ -1612,10 +1611,10 @@ Handle<Value> Connection::GetSession(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
if (ss->ssl_ == NULL) return Undefined(node_isolate); if (ss->ssl_ == NULL) return Undefined();
SSL_SESSION* sess = SSL_get_session(ss->ssl_); SSL_SESSION* sess = SSL_get_session(ss->ssl_);
if (!sess) return Undefined(node_isolate); if (!sess) return Undefined();
int slen = i2d_SSL_SESSION(sess, NULL); int slen = i2d_SSL_SESSION(sess, NULL);
assert(slen > 0); assert(slen > 0);
@ -1629,7 +1628,7 @@ Handle<Value> Connection::GetSession(const Arguments& args) {
return scope.Close(s); return scope.Close(s);
} }
return Null(node_isolate); return Null();
} }
Handle<Value> Connection::SetSession(const Arguments& args) { Handle<Value> Connection::SetSession(const Arguments& args) {
@ -1662,7 +1661,7 @@ Handle<Value> Connection::SetSession(const Arguments& args) {
delete [] sbuf; delete [] sbuf;
if (!sess) if (!sess)
return Undefined(node_isolate); return Undefined();
int r = SSL_set_session(ss->ssl_, sess); int r = SSL_set_session(ss->ssl_, sess);
SSL_SESSION_free(sess); SSL_SESSION_free(sess);
@ -1672,7 +1671,7 @@ Handle<Value> Connection::SetSession(const Arguments& args) {
return ThrowException(Exception::Error(eStr)); return ThrowException(Exception::Error(eStr));
} }
return True(node_isolate); return True();
} }
Handle<Value> Connection::LoadSession(const Arguments& args) { Handle<Value> Connection::LoadSession(const Arguments& args) {
@ -1696,7 +1695,7 @@ Handle<Value> Connection::LoadSession(const Arguments& args) {
ss->hello_parser_.Finish(); ss->hello_parser_.Finish();
return True(node_isolate); return True();
} }
Handle<Value> Connection::IsSessionReused(const Arguments& args) { Handle<Value> Connection::IsSessionReused(const Arguments& args) {
@ -1705,10 +1704,10 @@ Handle<Value> Connection::IsSessionReused(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
if (ss->ssl_ == NULL || SSL_session_reused(ss->ssl_) == false) { if (ss->ssl_ == NULL || SSL_session_reused(ss->ssl_) == false) {
return False(node_isolate); return False();
} }
return True(node_isolate); return True();
} }
@ -1727,10 +1726,10 @@ Handle<Value> Connection::Start(const Arguments& args) {
ss->HandleSSLError("SSL_connect:Start", rv, kZeroIsAnError); ss->HandleSSLError("SSL_connect:Start", rv, kZeroIsAnError);
} }
return scope.Close(Integer::New(rv, node_isolate)); return scope.Close(Integer::New(rv));
} }
return scope.Close(Integer::New(0, node_isolate)); return scope.Close(Integer::New(0));
} }
@ -1739,12 +1738,12 @@ Handle<Value> Connection::Shutdown(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
if (ss->ssl_ == NULL) return False(node_isolate); if (ss->ssl_ == NULL) return False();
int rv = SSL_shutdown(ss->ssl_); int rv = SSL_shutdown(ss->ssl_);
ss->HandleSSLError("SSL_shutdown", rv, kZeroIsNotAnError); ss->HandleSSLError("SSL_shutdown", rv, kZeroIsNotAnError);
ss->SetShutdownFlags(); ss->SetShutdownFlags();
return scope.Close(Integer::New(rv, node_isolate)); return scope.Close(Integer::New(rv));
} }
@ -1753,12 +1752,12 @@ Handle<Value> Connection::ReceivedShutdown(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
if (ss->ssl_ == NULL) return False(node_isolate); if (ss->ssl_ == NULL) return False();
int r = SSL_get_shutdown(ss->ssl_); int r = SSL_get_shutdown(ss->ssl_);
if (r & SSL_RECEIVED_SHUTDOWN) return True(node_isolate); if (r & SSL_RECEIVED_SHUTDOWN) return True();
return False(node_isolate); return False();
} }
@ -1768,10 +1767,10 @@ Handle<Value> Connection::IsInitFinished(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
if (ss->ssl_ == NULL || SSL_is_init_finished(ss->ssl_) == false) { if (ss->ssl_ == NULL || SSL_is_init_finished(ss->ssl_) == false) {
return False(node_isolate); return False();
} }
return True(node_isolate); return True();
} }
@ -1780,7 +1779,7 @@ Handle<Value> Connection::VerifyError(const Arguments& args) {
Connection *ss = Connection::Unwrap(args); Connection *ss = Connection::Unwrap(args);
if (ss->ssl_ == NULL) return Null(node_isolate); if (ss->ssl_ == NULL) return Null();
// XXX Do this check in JS land? // XXX Do this check in JS land?
@ -1801,7 +1800,7 @@ Handle<Value> Connection::VerifyError(const Arguments& args) {
switch (x509_verify_error) { switch (x509_verify_error) {
case X509_V_OK: case X509_V_OK:
return Null(node_isolate); return Null();
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
s = String::New("UNABLE_TO_GET_ISSUER_CERT"); s = String::New("UNABLE_TO_GET_ISSUER_CERT");
@ -1927,9 +1926,9 @@ Handle<Value> Connection::GetCurrentCipher(const Arguments& args) {
OPENSSL_CONST SSL_CIPHER *c; OPENSSL_CONST SSL_CIPHER *c;
if ( ss->ssl_ == NULL ) return Undefined(node_isolate); if ( ss->ssl_ == NULL ) return Undefined();
c = SSL_get_current_cipher(ss->ssl_); c = SSL_get_current_cipher(ss->ssl_);
if ( c == NULL ) return Undefined(node_isolate); if ( c == NULL ) return Undefined();
Local<Object> info = Object::New(); Local<Object> info = Object::New();
const char* cipher_name = SSL_CIPHER_get_name(c); const char* cipher_name = SSL_CIPHER_get_name(c);
info->Set(name_symbol, String::New(cipher_name)); info->Set(name_symbol, String::New(cipher_name));
@ -1947,7 +1946,7 @@ Handle<Value> Connection::Close(const Arguments& args) {
SSL_free(ss->ssl_); SSL_free(ss->ssl_);
ss->ssl_ = NULL; ss->ssl_ = NULL;
} }
return True(node_isolate); return True();
} }
#ifdef OPENSSL_NPN_NEGOTIATED #ifdef OPENSSL_NPN_NEGOTIATED
@ -1963,7 +1962,7 @@ Handle<Value> Connection::GetNegotiatedProto(const Arguments& args) {
SSL_get0_next_proto_negotiated(ss->ssl_, &npn_proto, &npn_proto_len); SSL_get0_next_proto_negotiated(ss->ssl_, &npn_proto, &npn_proto_len);
if (!npn_proto) { if (!npn_proto) {
return False(node_isolate); return False();
} }
return String::New((const char*) npn_proto, npn_proto_len); return String::New((const char*) npn_proto, npn_proto_len);
@ -1988,7 +1987,7 @@ Handle<Value> Connection::SetNPNProtocols(const Arguments& args) {
} }
ss->npnProtos_ = Persistent<Object>::New(args[0]->ToObject()); ss->npnProtos_ = Persistent<Object>::New(args[0]->ToObject());
return True(node_isolate); return True();
}; };
#endif #endif
@ -2001,7 +2000,7 @@ Handle<Value> Connection::GetServername(const Arguments& args) {
if (ss->is_server_ && !ss->servername_.IsEmpty()) { if (ss->is_server_ && !ss->servername_.IsEmpty()) {
return ss->servername_; return ss->servername_;
} else { } else {
return False(node_isolate); return False();
} }
} }
@ -2022,7 +2021,7 @@ Handle<Value> Connection::SetSNICallback(const Arguments& args) {
ss->sniObject_ = Persistent<Object>::New(Object::New()); ss->sniObject_ = Persistent<Object>::New(Object::New());
ss->sniObject_->Set(String::New("onselect"), args[0]); ss->sniObject_->Set(String::New("onselect"), args[0]);
return True(node_isolate); return True();
} }
#endif #endif
@ -2256,7 +2255,7 @@ class Cipher : public ObjectWrap {
cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue()); cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue());
return Undefined(node_isolate); return Undefined();
} }
static Handle<Value> CipherFinal(const Arguments& args) { static Handle<Value> CipherFinal(const Arguments& args) {
@ -2570,7 +2569,7 @@ class Decipher : public ObjectWrap {
cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue()); cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue());
return Undefined(node_isolate); return Undefined();
} }
static Handle<Value> DecipherFinal(const Arguments& args) { static Handle<Value> DecipherFinal(const Arguments& args) {
@ -3719,12 +3718,12 @@ void EIO_PBKDF2(uv_work_t* work_req) {
void EIO_PBKDF2After(pbkdf2_req* req, Local<Value> argv[2]) { void EIO_PBKDF2After(pbkdf2_req* req, Local<Value> argv[2]) {
if (req->err) { if (req->err) {
argv[0] = Local<Value>::New(node_isolate, Undefined(node_isolate)); argv[0] = Local<Value>::New(Undefined());
argv[1] = Encode(req->key, req->keylen, BUFFER); argv[1] = Encode(req->key, req->keylen, BUFFER);
memset(req->key, 0, req->keylen); memset(req->key, 0, req->keylen);
} else { } else {
argv[0] = Exception::Error(String::New("PBKDF2 error")); argv[0] = Exception::Error(String::New("PBKDF2 error"));
argv[1] = Local<Value>::New(node_isolate, Undefined(node_isolate)); argv[1] = Local<Value>::New(Undefined());
} }
delete[] req->pass; delete[] req->pass;
@ -3826,7 +3825,7 @@ Handle<Value> PBKDF2(const Arguments& args) {
&req->work_req, &req->work_req,
EIO_PBKDF2, EIO_PBKDF2,
EIO_PBKDF2After); EIO_PBKDF2After);
return Undefined(node_isolate); return Undefined();
} else { } else {
Local<Value> argv[2]; Local<Value> argv[2];
EIO_PBKDF2(req); EIO_PBKDF2(req);
@ -3897,13 +3896,13 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
ERR_error_string_n(req->error_, errmsg, sizeof errmsg); ERR_error_string_n(req->error_, errmsg, sizeof errmsg);
argv[0] = Exception::Error(String::New(errmsg)); argv[0] = Exception::Error(String::New(errmsg));
argv[1] = Local<Value>::New(node_isolate, Null(node_isolate)); argv[1] = Local<Value>::New(Null());
} }
else { else {
// avoids the malloc + memcpy // avoids the malloc + memcpy
Buffer* buffer = Buffer::New(req->data_, req->size_, RandomBytesFree, NULL); Buffer* buffer = Buffer::New(req->data_, req->size_, RandomBytesFree, NULL);
argv[0] = Local<Value>::New(node_isolate, Null(node_isolate)); argv[0] = Local<Value>::New(Null());
argv[1] = Local<Object>::New(node_isolate, buffer->handle_); argv[1] = Local<Object>::New(buffer->handle_);
} }
} }

32
src/node_dtrace.cc

@ -129,7 +129,7 @@ using namespace v8;
Handle<Value> DTRACE_NET_SERVER_CONNECTION(const Arguments& args) { Handle<Value> DTRACE_NET_SERVER_CONNECTION(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP #ifndef HAVE_SYSTEMTAP
if (!NODE_NET_SERVER_CONNECTION_ENABLED()) if (!NODE_NET_SERVER_CONNECTION_ENABLED())
return Undefined(node_isolate); return Undefined();
#endif #endif
HandleScope scope; HandleScope scope;
@ -142,13 +142,13 @@ Handle<Value> DTRACE_NET_SERVER_CONNECTION(const Arguments& args) {
NODE_NET_SERVER_CONNECTION(&conn); NODE_NET_SERVER_CONNECTION(&conn);
#endif #endif
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> DTRACE_NET_STREAM_END(const Arguments& args) { Handle<Value> DTRACE_NET_STREAM_END(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP #ifndef HAVE_SYSTEMTAP
if (!NODE_NET_STREAM_END_ENABLED()) if (!NODE_NET_STREAM_END_ENABLED())
return Undefined(node_isolate); return Undefined();
#endif #endif
HandleScope scope; HandleScope scope;
@ -160,13 +160,13 @@ Handle<Value> DTRACE_NET_STREAM_END(const Arguments& args) {
NODE_NET_STREAM_END(&conn); NODE_NET_STREAM_END(&conn);
#endif #endif
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> DTRACE_NET_SOCKET_READ(const Arguments& args) { Handle<Value> DTRACE_NET_SOCKET_READ(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP #ifndef HAVE_SYSTEMTAP
if (!NODE_NET_SOCKET_READ_ENABLED()) if (!NODE_NET_SOCKET_READ_ENABLED())
return Undefined(node_isolate); return Undefined();
#endif #endif
HandleScope scope; HandleScope scope;
@ -184,13 +184,13 @@ Handle<Value> DTRACE_NET_SOCKET_READ(const Arguments& args) {
NODE_NET_SOCKET_READ(&conn, nbytes); NODE_NET_SOCKET_READ(&conn, nbytes);
#endif #endif
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> DTRACE_NET_SOCKET_WRITE(const Arguments& args) { Handle<Value> DTRACE_NET_SOCKET_WRITE(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP #ifndef HAVE_SYSTEMTAP
if (!NODE_NET_SOCKET_WRITE_ENABLED()) if (!NODE_NET_SOCKET_WRITE_ENABLED())
return Undefined(node_isolate); return Undefined();
#endif #endif
HandleScope scope; HandleScope scope;
@ -208,7 +208,7 @@ Handle<Value> DTRACE_NET_SOCKET_WRITE(const Arguments& args) {
NODE_NET_SOCKET_WRITE(&conn, nbytes); NODE_NET_SOCKET_WRITE(&conn, nbytes);
#endif #endif
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> DTRACE_HTTP_SERVER_REQUEST(const Arguments& args) { Handle<Value> DTRACE_HTTP_SERVER_REQUEST(const Arguments& args) {
@ -216,7 +216,7 @@ Handle<Value> DTRACE_HTTP_SERVER_REQUEST(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP #ifndef HAVE_SYSTEMTAP
if (!NODE_HTTP_SERVER_REQUEST_ENABLED()) if (!NODE_HTTP_SERVER_REQUEST_ENABLED())
return Undefined(node_isolate); return Undefined();
#endif #endif
HandleScope scope; HandleScope scope;
@ -249,13 +249,13 @@ Handle<Value> DTRACE_HTTP_SERVER_REQUEST(const Arguments& args) {
#else #else
NODE_HTTP_SERVER_REQUEST(&req, &conn); NODE_HTTP_SERVER_REQUEST(&req, &conn);
#endif #endif
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> DTRACE_HTTP_SERVER_RESPONSE(const Arguments& args) { Handle<Value> DTRACE_HTTP_SERVER_RESPONSE(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP #ifndef HAVE_SYSTEMTAP
if (!NODE_HTTP_SERVER_RESPONSE_ENABLED()) if (!NODE_HTTP_SERVER_RESPONSE_ENABLED())
return Undefined(node_isolate); return Undefined();
#endif #endif
HandleScope scope; HandleScope scope;
@ -267,7 +267,7 @@ Handle<Value> DTRACE_HTTP_SERVER_RESPONSE(const Arguments& args) {
NODE_HTTP_SERVER_RESPONSE(&conn); NODE_HTTP_SERVER_RESPONSE(&conn);
#endif #endif
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> DTRACE_HTTP_CLIENT_REQUEST(const Arguments& args) { Handle<Value> DTRACE_HTTP_CLIENT_REQUEST(const Arguments& args) {
@ -276,7 +276,7 @@ Handle<Value> DTRACE_HTTP_CLIENT_REQUEST(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP #ifndef HAVE_SYSTEMTAP
if (!NODE_HTTP_CLIENT_REQUEST_ENABLED()) if (!NODE_HTTP_CLIENT_REQUEST_ENABLED())
return Undefined(node_isolate); return Undefined();
#endif #endif
HandleScope scope; HandleScope scope;
@ -312,13 +312,13 @@ Handle<Value> DTRACE_HTTP_CLIENT_REQUEST(const Arguments& args) {
#else #else
NODE_HTTP_CLIENT_REQUEST(&req, &conn); NODE_HTTP_CLIENT_REQUEST(&req, &conn);
#endif #endif
return Undefined(node_isolate); return Undefined();
} }
Handle<Value> DTRACE_HTTP_CLIENT_RESPONSE(const Arguments& args) { Handle<Value> DTRACE_HTTP_CLIENT_RESPONSE(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP #ifndef HAVE_SYSTEMTAP
if (!NODE_HTTP_CLIENT_RESPONSE_ENABLED()) if (!NODE_HTTP_CLIENT_RESPONSE_ENABLED())
return Undefined(node_isolate); return Undefined();
#endif #endif
HandleScope scope; HandleScope scope;
@ -329,7 +329,7 @@ Handle<Value> DTRACE_HTTP_CLIENT_RESPONSE(const Arguments& args) {
NODE_HTTP_CLIENT_RESPONSE(&conn); NODE_HTTP_CLIENT_RESPONSE(&conn);
#endif #endif
return Undefined(node_isolate); return Undefined();
} }
#define NODE_PROBE(name) #name, name, Persistent<FunctionTemplate>() #define NODE_PROBE(name) #name, name, Persistent<FunctionTemplate>()

52
src/node_file.cc

@ -113,7 +113,7 @@ static void After(uv_fs_t *req) {
} }
} else { } else {
// error value is empty or null for non-error. // error value is empty or null for non-error.
argv[0] = Local<Value>::New(node_isolate, Null(node_isolate)); argv[0] = Local<Value>::New(Null());
// All have at least two args now. // All have at least two args now.
argc = 2; argc = 2;
@ -144,11 +144,11 @@ static void After(uv_fs_t *req) {
break; break;
case UV_FS_OPEN: case UV_FS_OPEN:
argv[1] = Integer::New(req->result, node_isolate); argv[1] = Integer::New(req->result);
break; break;
case UV_FS_WRITE: case UV_FS_WRITE:
argv[1] = Integer::New(req->result, node_isolate); argv[1] = Integer::New(req->result);
break; break;
case UV_FS_STAT: case UV_FS_STAT:
@ -163,7 +163,7 @@ static void After(uv_fs_t *req) {
case UV_FS_READ: case UV_FS_READ:
// Buffer interface // Buffer interface
argv[1] = Integer::New(req->result, node_isolate); argv[1] = Integer::New(req->result);
break; break;
case UV_FS_READDIR: case UV_FS_READDIR:
@ -175,7 +175,7 @@ static void After(uv_fs_t *req) {
for (int i = 0; i < nnames; i++) { for (int i = 0; i < nnames; i++) {
Local<String> name = String::New(namebuf); Local<String> name = String::New(namebuf);
names->Set(Integer::New(i, node_isolate), name); names->Set(Integer::New(i), name);
#ifndef NDEBUG #ifndef NDEBUG
namebuf += strlen(namebuf); namebuf += strlen(namebuf);
assert(*namebuf == '\0'); assert(*namebuf == '\0');
@ -256,7 +256,7 @@ static Handle<Value> Close(const Arguments& args) {
ASYNC_CALL(close, args[1], fd) ASYNC_CALL(close, args[1], fd)
} else { } else {
SYNC_CALL(close, 0, fd) SYNC_CALL(close, 0, fd)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -314,7 +314,7 @@ Local<Object> BuildStatsObject(const uv_statbuf_t* s) {
// and make sure that we bail out when V8 returns an empty handle. // and make sure that we bail out when V8 returns an empty handle.
#define X(name) \ #define X(name) \
{ \ { \
Local<Value> val = Integer::New(s->st_##name, node_isolate); \ Local<Value> val = Integer::New(s->st_##name); \
if (val.IsEmpty()) return Local<Object>(); \ if (val.IsEmpty()) return Local<Object>(); \
stats->Set(name##_symbol, val); \ stats->Set(name##_symbol, val); \
} }
@ -437,7 +437,7 @@ static Handle<Value> Symlink(const Arguments& args) {
ASYNC_CALL(symlink, args[3], *dest, *path, flags) ASYNC_CALL(symlink, args[3], *dest, *path, flags)
} else { } else {
SYNC_CALL(symlink, *path, *dest, *path, flags) SYNC_CALL(symlink, *path, *dest, *path, flags)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -457,7 +457,7 @@ static Handle<Value> Link(const Arguments& args) {
ASYNC_CALL(link, args[2], *orig_path, *new_path) ASYNC_CALL(link, args[2], *orig_path, *new_path)
} else { } else {
SYNC_CALL(link, *orig_path, *orig_path, *new_path) SYNC_CALL(link, *orig_path, *orig_path, *new_path)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -493,7 +493,7 @@ static Handle<Value> Rename(const Arguments& args) {
ASYNC_CALL(rename, args[2], *old_path, *new_path) ASYNC_CALL(rename, args[2], *old_path, *new_path)
} else { } else {
SYNC_CALL(rename, *old_path, *old_path, *new_path) SYNC_CALL(rename, *old_path, *old_path, *new_path)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -513,7 +513,7 @@ static Handle<Value> FTruncate(const Arguments& args) {
ASYNC_CALL(ftruncate, args[2], fd, len) ASYNC_CALL(ftruncate, args[2], fd, len)
} else { } else {
SYNC_CALL(ftruncate, 0, fd, len) SYNC_CALL(ftruncate, 0, fd, len)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -530,7 +530,7 @@ static Handle<Value> Fdatasync(const Arguments& args) {
ASYNC_CALL(fdatasync, args[1], fd) ASYNC_CALL(fdatasync, args[1], fd)
} else { } else {
SYNC_CALL(fdatasync, 0, fd) SYNC_CALL(fdatasync, 0, fd)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -547,7 +547,7 @@ static Handle<Value> Fsync(const Arguments& args) {
ASYNC_CALL(fsync, args[1], fd) ASYNC_CALL(fsync, args[1], fd)
} else { } else {
SYNC_CALL(fsync, 0, fd) SYNC_CALL(fsync, 0, fd)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -563,7 +563,7 @@ static Handle<Value> Unlink(const Arguments& args) {
ASYNC_CALL(unlink, args[1], *path) ASYNC_CALL(unlink, args[1], *path)
} else { } else {
SYNC_CALL(unlink, *path, *path) SYNC_CALL(unlink, *path, *path)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -579,7 +579,7 @@ static Handle<Value> RMDir(const Arguments& args) {
ASYNC_CALL(rmdir, args[1], *path) ASYNC_CALL(rmdir, args[1], *path)
} else { } else {
SYNC_CALL(rmdir, *path, *path) SYNC_CALL(rmdir, *path, *path)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -597,7 +597,7 @@ static Handle<Value> MKDir(const Arguments& args) {
ASYNC_CALL(mkdir, args[2], *path, mode) ASYNC_CALL(mkdir, args[2], *path, mode)
} else { } else {
SYNC_CALL(mkdir, *path, *path, mode) SYNC_CALL(mkdir, *path, *path, mode)
return Undefined(node_isolate); return Undefined();
} }
} }
@ -620,7 +620,7 @@ static Handle<Value> ReadDir(const Arguments& args) {
for (int i = 0; i < nnames; i++) { for (int i = 0; i < nnames; i++) {
Local<String> name = String::New(namebuf); Local<String> name = String::New(namebuf);
names->Set(Integer::New(i, node_isolate), name); names->Set(Integer::New(i), name);
#ifndef NDEBUG #ifndef NDEBUG
namebuf += strlen(namebuf); namebuf += strlen(namebuf);
assert(*namebuf == '\0'); assert(*namebuf == '\0');
@ -654,7 +654,7 @@ static Handle<Value> Open(const Arguments& args) {
} else { } else {
SYNC_CALL(open, *path, *path, flags, mode) SYNC_CALL(open, *path, *path, flags, mode)
int fd = SYNC_RESULT; int fd = SYNC_RESULT;
return scope.Close(Integer::New(fd, node_isolate)); return scope.Close(Integer::New(fd));
} }
} }
@ -707,7 +707,7 @@ static Handle<Value> Write(const Arguments& args) {
ASYNC_CALL(write, cb, fd, buf, len, pos) ASYNC_CALL(write, cb, fd, buf, len, pos)
} else { } else {
SYNC_CALL(write, 0, fd, buf, len, pos) SYNC_CALL(write, 0, fd, buf, len, pos)
return scope.Close(Integer::New(SYNC_RESULT, node_isolate)); return scope.Close(Integer::New(SYNC_RESULT));
} }
} }
@ -770,7 +770,7 @@ static Handle<Value> Read(const Arguments& args) {
ASYNC_CALL(read, cb, fd, buf, len, pos); ASYNC_CALL(read, cb, fd, buf, len, pos);
} else { } else {
SYNC_CALL(read, 0, fd, buf, len, pos) SYNC_CALL(read, 0, fd, buf, len, pos)
Local<Integer> bytesRead = Integer::New(SYNC_RESULT, node_isolate); Local<Integer> bytesRead = Integer::New(SYNC_RESULT);
return scope.Close(bytesRead); return scope.Close(bytesRead);
} }
} }
@ -792,7 +792,7 @@ static Handle<Value> Chmod(const Arguments& args) {
ASYNC_CALL(chmod, args[2], *path, mode); ASYNC_CALL(chmod, args[2], *path, mode);
} else { } else {
SYNC_CALL(chmod, *path, *path, mode); SYNC_CALL(chmod, *path, *path, mode);
return Undefined(node_isolate); return Undefined();
} }
} }
@ -813,7 +813,7 @@ static Handle<Value> FChmod(const Arguments& args) {
ASYNC_CALL(fchmod, args[2], fd, mode); ASYNC_CALL(fchmod, args[2], fd, mode);
} else { } else {
SYNC_CALL(fchmod, 0, fd, mode); SYNC_CALL(fchmod, 0, fd, mode);
return Undefined(node_isolate); return Undefined();
} }
} }
@ -840,7 +840,7 @@ static Handle<Value> Chown(const Arguments& args) {
ASYNC_CALL(chown, args[3], *path, uid, gid); ASYNC_CALL(chown, args[3], *path, uid, gid);
} else { } else {
SYNC_CALL(chown, *path, *path, uid, gid); SYNC_CALL(chown, *path, *path, uid, gid);
return Undefined(node_isolate); return Undefined();
} }
} }
@ -867,7 +867,7 @@ static Handle<Value> FChown(const Arguments& args) {
ASYNC_CALL(fchown, args[3], fd, uid, gid); ASYNC_CALL(fchown, args[3], fd, uid, gid);
} else { } else {
SYNC_CALL(fchown, 0, fd, uid, gid); SYNC_CALL(fchown, 0, fd, uid, gid);
return Undefined(node_isolate); return Undefined();
} }
} }
@ -891,7 +891,7 @@ static Handle<Value> UTimes(const Arguments& args) {
ASYNC_CALL(utime, args[3], *path, atime, mtime); ASYNC_CALL(utime, args[3], *path, atime, mtime);
} else { } else {
SYNC_CALL(utime, *path, *path, atime, mtime); SYNC_CALL(utime, *path, *path, atime, mtime);
return Undefined(node_isolate); return Undefined();
} }
} }
@ -914,7 +914,7 @@ static Handle<Value> FUTimes(const Arguments& args) {
ASYNC_CALL(futime, args[3], fd, atime, mtime); ASYNC_CALL(futime, args[3], fd, atime, mtime);
} else { } else {
SYNC_CALL(futime, 0, fd, atime, mtime); SYNC_CALL(futime, 0, fd, atime, mtime);
return Undefined(node_isolate); return Undefined();
} }
} }

32
src/node_http_parser.cc

@ -170,7 +170,7 @@ struct StringPtr {
if (str_) if (str_)
return String::New(str_, size_); return String::New(str_, size_);
else else
return String::Empty(node_isolate); return String::Empty();
} }
@ -270,22 +270,22 @@ public:
// STATUS // STATUS
if (parser_.type == HTTP_RESPONSE) { if (parser_.type == HTTP_RESPONSE) {
message_info->Set(status_code_sym, message_info->Set(status_code_sym,
Integer::New(parser_.status_code, node_isolate)); Integer::New(parser_.status_code));
} }
// VERSION // VERSION
message_info->Set(version_major_sym, message_info->Set(version_major_sym,
Integer::New(parser_.http_major, node_isolate)); Integer::New(parser_.http_major));
message_info->Set(version_minor_sym, message_info->Set(version_minor_sym,
Integer::New(parser_.http_minor, node_isolate)); Integer::New(parser_.http_minor));
message_info->Set(should_keep_alive_sym, message_info->Set(should_keep_alive_sym,
http_should_keep_alive(&parser_) ? True(node_isolate) http_should_keep_alive(&parser_) ? True()
: False(node_isolate)); : False());
message_info->Set(upgrade_sym, message_info->Set(upgrade_sym,
parser_.upgrade ? True(node_isolate) parser_.upgrade ? True()
: False(node_isolate)); : False());
Local<Value> argv[1] = { message_info }; Local<Value> argv[1] = { message_info };
@ -310,8 +310,8 @@ public:
Local<Value> argv[3] = { Local<Value> argv[3] = {
*current_buffer, *current_buffer,
Integer::New(at - current_buffer_data, node_isolate), Integer::New(at - current_buffer_data),
Integer::New(length, node_isolate) Integer::New(length)
}; };
Local<Value> r = Local<Function>::Cast(cb)->Call(handle_, 3, argv); Local<Value> r = Local<Function>::Cast(cb)->Call(handle_, 3, argv);
@ -434,7 +434,7 @@ public:
// If there was an exception in one of the callbacks // If there was an exception in one of the callbacks
if (parser->got_exception_) return Local<Value>(); if (parser->got_exception_) return Local<Value>();
Local<Integer> nparsed_obj = Integer::New(nparsed, node_isolate); Local<Integer> nparsed_obj = Integer::New(nparsed);
// If there was a parse error in one of the callbacks // If there was a parse error in one of the callbacks
// TODO What if there is an error on EOF? // TODO What if there is an error on EOF?
if (!parser->parser_.upgrade && nparsed != len) { if (!parser->parser_.upgrade && nparsed != len) {
@ -468,12 +468,12 @@ public:
Local<Value> e = Exception::Error(String::NewSymbol("Parse Error")); Local<Value> e = Exception::Error(String::NewSymbol("Parse Error"));
Local<Object> obj = e->ToObject(); Local<Object> obj = e->ToObject();
obj->Set(String::NewSymbol("bytesParsed"), Integer::New(0, node_isolate)); obj->Set(String::NewSymbol("bytesParsed"), Integer::New(0));
obj->Set(String::NewSymbol("code"), String::New(http_errno_name(err))); obj->Set(String::NewSymbol("code"), String::New(http_errno_name(err)));
return scope.Close(e); return scope.Close(e);
} }
return Undefined(node_isolate); return Undefined();
} }
@ -491,7 +491,7 @@ public:
Parser* parser = ObjectWrap::Unwrap<Parser>(args.This()); Parser* parser = ObjectWrap::Unwrap<Parser>(args.This());
parser->Init(type); parser->Init(type);
return Undefined(node_isolate); return Undefined();
} }
@ -565,10 +565,10 @@ void InitHttpParser(Handle<Object> target) {
PropertyAttribute attrib = (PropertyAttribute) (ReadOnly | DontDelete); PropertyAttribute attrib = (PropertyAttribute) (ReadOnly | DontDelete);
t->Set(String::NewSymbol("REQUEST"), t->Set(String::NewSymbol("REQUEST"),
Integer::New(HTTP_REQUEST, node_isolate), Integer::New(HTTP_REQUEST),
attrib); attrib);
t->Set(String::NewSymbol("RESPONSE"), t->Set(String::NewSymbol("RESPONSE"),
Integer::New(HTTP_RESPONSE, node_isolate), Integer::New(HTTP_RESPONSE),
attrib); attrib);
NODE_SET_PROTOTYPE_METHOD(t, "execute", Parser::Execute); NODE_SET_PROTOTYPE_METHOD(t, "execute", Parser::Execute);

2
src/node_internals.h

@ -90,7 +90,7 @@ inline static v8::Handle<v8::Value> ThrowRangeError(const char* errmsg) {
assert(!args.Holder().IsEmpty()); \ assert(!args.Holder().IsEmpty()); \
assert(args.Holder()->InternalFieldCount() > 0); \ assert(args.Holder()->InternalFieldCount() > 0); \
type* wrap = static_cast<type*>( \ type* wrap = static_cast<type*>( \
args.Holder()->GetAlignedPointerFromInternalField(0)); \ args.Holder()->GetPointerFromInternalField(0)); \
if (!wrap) { \ if (!wrap) { \
fprintf(stderr, #type ": Aborting due to unwrap failure at %s:%d\n", \ fprintf(stderr, #type ": Aborting due to unwrap failure at %s:%d\n", \
__FILE__, __LINE__); \ __FILE__, __LINE__); \

4
src/node_object_wrap.h

@ -59,7 +59,7 @@ class NODE_EXTERN ObjectWrap {
static inline T* Unwrap (v8::Handle<v8::Object> handle) { static inline T* Unwrap (v8::Handle<v8::Object> handle) {
assert(!handle.IsEmpty()); assert(!handle.IsEmpty());
assert(handle->InternalFieldCount() > 0); assert(handle->InternalFieldCount() > 0);
return static_cast<T*>(handle->GetAlignedPointerFromInternalField(0)); return static_cast<T*>(handle->GetPointerFromInternalField(0));
} }
@ -70,7 +70,7 @@ class NODE_EXTERN ObjectWrap {
assert(handle_.IsEmpty()); assert(handle_.IsEmpty());
assert(handle->InternalFieldCount() > 0); assert(handle->InternalFieldCount() > 0);
handle_ = v8::Persistent<v8::Object>::New(handle); handle_ = v8::Persistent<v8::Object>::New(handle);
handle_->SetAlignedPointerInInternalField(0, this); handle_->SetPointerInInternalField(0, this);
MakeWeak(); MakeWeak();
} }

24
src/node_os.cc

@ -98,7 +98,7 @@ static Handle<Value> GetOSRelease(const Arguments& args) {
info.dwOSVersionInfoSize = sizeof(info); info.dwOSVersionInfoSize = sizeof(info);
if (GetVersionEx(&info) == 0) { if (GetVersionEx(&info) == 0) {
return Undefined(node_isolate); return Undefined();
} }
sprintf(release, "%d.%d.%d", static_cast<int>(info.dwMajorVersion), sprintf(release, "%d.%d.%d", static_cast<int>(info.dwMajorVersion),
@ -116,7 +116,7 @@ static Handle<Value> GetCPUInfo(const Arguments& args) {
uv_err_t err = uv_cpu_info(&cpu_infos, &count); uv_err_t err = uv_cpu_info(&cpu_infos, &count);
if (err.code != UV_OK) { if (err.code != UV_OK) {
return Undefined(node_isolate); return Undefined();
} }
Local<Array> cpus = Array::New(); Local<Array> cpus = Array::New();
@ -124,20 +124,20 @@ static Handle<Value> GetCPUInfo(const Arguments& args) {
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
Local<Object> times_info = Object::New(); Local<Object> times_info = Object::New();
times_info->Set(String::New("user"), times_info->Set(String::New("user"),
Integer::New(cpu_infos[i].cpu_times.user, node_isolate)); Integer::New(cpu_infos[i].cpu_times.user));
times_info->Set(String::New("nice"), times_info->Set(String::New("nice"),
Integer::New(cpu_infos[i].cpu_times.nice, node_isolate)); Integer::New(cpu_infos[i].cpu_times.nice));
times_info->Set(String::New("sys"), times_info->Set(String::New("sys"),
Integer::New(cpu_infos[i].cpu_times.sys, node_isolate)); Integer::New(cpu_infos[i].cpu_times.sys));
times_info->Set(String::New("idle"), times_info->Set(String::New("idle"),
Integer::New(cpu_infos[i].cpu_times.idle, node_isolate)); Integer::New(cpu_infos[i].cpu_times.idle));
times_info->Set(String::New("irq"), times_info->Set(String::New("irq"),
Integer::New(cpu_infos[i].cpu_times.irq, node_isolate)); Integer::New(cpu_infos[i].cpu_times.irq));
Local<Object> cpu_info = Object::New(); Local<Object> cpu_info = Object::New();
cpu_info->Set(String::New("model"), String::New(cpu_infos[i].model)); cpu_info->Set(String::New("model"), String::New(cpu_infos[i].model));
cpu_info->Set(String::New("speed"), cpu_info->Set(String::New("speed"),
Integer::New(cpu_infos[i].speed, node_isolate)); Integer::New(cpu_infos[i].speed));
cpu_info->Set(String::New("times"), times_info); cpu_info->Set(String::New("times"), times_info);
(*cpus)->Set(i,cpu_info); (*cpus)->Set(i,cpu_info);
} }
@ -152,7 +152,7 @@ static Handle<Value> GetFreeMemory(const Arguments& args) {
double amount = uv_get_free_memory(); double amount = uv_get_free_memory();
if (amount < 0) { if (amount < 0) {
return Undefined(node_isolate); return Undefined();
} }
return scope.Close(Number::New(amount)); return scope.Close(Number::New(amount));
@ -163,7 +163,7 @@ static Handle<Value> GetTotalMemory(const Arguments& args) {
double amount = uv_get_total_memory(); double amount = uv_get_total_memory();
if (amount < 0) { if (amount < 0) {
return Undefined(node_isolate); return Undefined();
} }
return scope.Close(Number::New(amount)); return scope.Close(Number::New(amount));
@ -176,7 +176,7 @@ static Handle<Value> GetUptime(const Arguments& args) {
uv_err_t err = uv_uptime(&uptime); uv_err_t err = uv_uptime(&uptime);
if (err.code != UV_OK) { if (err.code != UV_OK) {
return Undefined(node_isolate); return Undefined();
} }
return scope.Close(Number::New(uptime)); return scope.Close(Number::New(uptime));
@ -238,7 +238,7 @@ static Handle<Value> GetInterfaceAddresses(const Arguments& args) {
const bool internal = interfaces[i].is_internal; const bool internal = interfaces[i].is_internal;
o->Set(String::New("internal"), o->Set(String::New("internal"),
internal ? True(node_isolate) : False(node_isolate)); internal ? True() : False());
ifarr->Set(ifarr->Length(), o); ifarr->Set(ifarr->Length(), o);
} }

2
src/node_script.cc

@ -363,7 +363,7 @@ Handle<Value> WrappedScript::EvalMachine(const Arguments& args) {
// to a local handle, and then dispose the persistent handle. This ensures // to a local handle, and then dispose the persistent handle. This ensures
// that when this function exits the context will be disposed. // that when this function exits the context will be disposed.
Persistent<Context> tmp = Context::New(); Persistent<Context> tmp = Context::New();
context = Local<Context>::New(node_isolate, tmp); context = Local<Context>::New(tmp);
tmp.Dispose(); tmp.Dispose();
} else if (context_flag == userContext) { } else if (context_flag == userContext) {

6
src/node_stat_watcher.cc

@ -79,7 +79,7 @@ void StatWatcher::Callback(uv_fs_poll_t* handle,
Local<Value> argv[3]; Local<Value> argv[3];
argv[0] = BuildStatsObject(curr); argv[0] = BuildStatsObject(curr);
argv[1] = BuildStatsObject(prev); argv[1] = BuildStatsObject(prev);
argv[2] = Integer::New(status, node_isolate); argv[2] = Integer::New(status);
if (status == -1) { if (status == -1) {
SetErrno(uv_last_error(wrap->watcher_->loop)); SetErrno(uv_last_error(wrap->watcher_->loop));
} }
@ -112,7 +112,7 @@ Handle<Value> StatWatcher::Start(const Arguments& args) {
uv_fs_poll_start(wrap->watcher_, Callback, *path, interval); uv_fs_poll_start(wrap->watcher_, Callback, *path, interval);
wrap->Ref(); wrap->Ref();
return Undefined(node_isolate); return Undefined();
} }
@ -124,7 +124,7 @@ Handle<Value> StatWatcher::Stop(const Arguments& args) {
} }
MakeCallback(wrap->handle_, onstop_sym, 0, NULL); MakeCallback(wrap->handle_, onstop_sym, 0, NULL);
wrap->Stop(); wrap->Stop();
return Undefined(node_isolate); return Undefined();
} }

13
src/node_zlib.cc

@ -93,7 +93,7 @@ class ZCtx : public ObjectWrap {
HandleScope scope; HandleScope scope;
ZCtx *ctx = ObjectWrap::Unwrap<ZCtx>(args.This()); ZCtx *ctx = ObjectWrap::Unwrap<ZCtx>(args.This());
ctx->Close(); ctx->Close();
return scope.Close(Undefined(node_isolate)); return scope.Close(Undefined());
} }
@ -253,8 +253,8 @@ class ZCtx : public ObjectWrap {
return; return;
} }
Local<Integer> avail_out = Integer::New(ctx->strm_.avail_out, node_isolate); Local<Integer> avail_out = Integer::New(ctx->strm_.avail_out);
Local<Integer> avail_in = Integer::New(ctx->strm_.avail_in, node_isolate); Local<Integer> avail_in = Integer::New(ctx->strm_.avail_in);
ctx->write_in_progress_ = false; ctx->write_in_progress_ = false;
@ -279,8 +279,7 @@ class ZCtx : public ObjectWrap {
"Invalid error handler"); "Invalid error handler");
HandleScope scope; HandleScope scope;
Local<Value> args[2] = { String::New(msg), Local<Value> args[2] = { String::New(msg),
Local<Value>::New(node_isolate, Local<Value>::New(Number::New(ctx->err_)) };
Number::New(ctx->err_)) };
MakeCallback(ctx->handle_, onerror_sym, ARRAY_SIZE(args), args); MakeCallback(ctx->handle_, onerror_sym, ARRAY_SIZE(args), args);
// no hope of rescue. // no hope of rescue.
@ -342,7 +341,7 @@ class ZCtx : public ObjectWrap {
Init(ctx, level, windowBits, memLevel, strategy, Init(ctx, level, windowBits, memLevel, strategy,
dictionary, dictionary_len); dictionary, dictionary_len);
SetDictionary(ctx); SetDictionary(ctx);
return Undefined(node_isolate); return Undefined();
} }
static Handle<Value> Reset(const Arguments &args) { static Handle<Value> Reset(const Arguments &args) {
@ -352,7 +351,7 @@ class ZCtx : public ObjectWrap {
Reset(ctx); Reset(ctx);
SetDictionary(ctx); SetDictionary(ctx);
return Undefined(node_isolate); return Undefined();
} }
static void Init(ZCtx *ctx, int level, int windowBits, int memLevel, static void Init(ZCtx *ctx, int level, int windowBits, int memLevel,

22
src/pipe_wrap.cc

@ -69,7 +69,7 @@ Local<Object> PipeWrap::Instantiate() {
PipeWrap* PipeWrap::Unwrap(Local<Object> obj) { PipeWrap* PipeWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty()); assert(!obj.IsEmpty());
assert(obj->InternalFieldCount() > 0); assert(obj->InternalFieldCount() > 0);
return static_cast<PipeWrap*>(obj->GetAlignedPointerFromInternalField(0)); return static_cast<PipeWrap*>(obj->GetPointerFromInternalField(0));
} }
@ -156,7 +156,7 @@ Handle<Value> PipeWrap::Bind(const Arguments& args) {
// Error starting the pipe. // Error starting the pipe.
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -170,7 +170,7 @@ Handle<Value> PipeWrap::SetPendingInstances(const Arguments& args) {
uv_pipe_pending_instances(&wrap->handle_, instances); uv_pipe_pending_instances(&wrap->handle_, instances);
return v8::Null(node_isolate); return v8::Null();
} }
#endif #endif
@ -187,7 +187,7 @@ Handle<Value> PipeWrap::Listen(const Arguments& args) {
// Error starting the pipe. // Error starting the pipe.
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -214,7 +214,7 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) {
// Unwrap the client javascript object. // Unwrap the client javascript object.
assert(client_obj->InternalFieldCount() > 0); assert(client_obj->InternalFieldCount() > 0);
PipeWrap* client_wrap = PipeWrap* client_wrap =
static_cast<PipeWrap*>(client_obj->GetAlignedPointerFromInternalField(0)); static_cast<PipeWrap*>(client_obj->GetPointerFromInternalField(0));
if (uv_accept(handle, (uv_stream_t*)&client_wrap->handle_)) return; if (uv_accept(handle, (uv_stream_t*)&client_wrap->handle_)) return;
@ -248,11 +248,11 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) {
} }
Local<Value> argv[5] = { Local<Value> argv[5] = {
Integer::New(status, node_isolate), Integer::New(status),
Local<Value>::New(node_isolate, wrap->object_), Local<Value>::New(wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_), Local<Value>::New(req_wrap->object_),
Local<Value>::New(node_isolate, Boolean::New(readable)), Local<Value>::New(Boolean::New(readable)),
Local<Value>::New(node_isolate, Boolean::New(writable)) Local<Value>::New(Boolean::New(writable))
}; };
if (oncomplete_sym.IsEmpty()) { if (oncomplete_sym.IsEmpty()) {
@ -273,7 +273,7 @@ Handle<Value> PipeWrap::Open(const Arguments& args) {
uv_pipe_open(&wrap->handle_, fd); uv_pipe_open(&wrap->handle_, fd);
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} }

8
src/process_wrap.cc

@ -251,7 +251,7 @@ class ProcessWrap : public HandleWrap {
wrap->SetHandle((uv_handle_t*)&wrap->process_); wrap->SetHandle((uv_handle_t*)&wrap->process_);
assert(wrap->process_.data == wrap); assert(wrap->process_.data == wrap);
wrap->object_->Set(String::New("pid"), wrap->object_->Set(String::New("pid"),
Integer::New(wrap->process_.pid, node_isolate)); Integer::New(wrap->process_.pid));
} }
if (options.args) { if (options.args) {
@ -266,7 +266,7 @@ class ProcessWrap : public HandleWrap {
delete[] options.stdio; delete[] options.stdio;
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
static Handle<Value> Kill(const Arguments& args) { static Handle<Value> Kill(const Arguments& args) {
@ -280,7 +280,7 @@ class ProcessWrap : public HandleWrap {
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
static void OnExit(uv_process_t* handle, int exit_status, int term_signal) { static void OnExit(uv_process_t* handle, int exit_status, int term_signal) {
@ -291,7 +291,7 @@ class ProcessWrap : public HandleWrap {
assert(&wrap->process_ == handle); assert(&wrap->process_ == handle);
Local<Value> argv[2] = { Local<Value> argv[2] = {
Integer::New(exit_status, node_isolate), Integer::New(exit_status),
String::New(signo_string(term_signal)) String::New(signo_string(term_signal))
}; };

6
src/signal_wrap.cc

@ -97,7 +97,7 @@ class SignalWrap : public HandleWrap {
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
static Handle<Value> Stop(const Arguments& args) { static Handle<Value> Stop(const Arguments& args) {
@ -109,7 +109,7 @@ class SignalWrap : public HandleWrap {
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
static void OnSignal(uv_signal_t* handle, int signum) { static void OnSignal(uv_signal_t* handle, int signum) {
@ -118,7 +118,7 @@ class SignalWrap : public HandleWrap {
SignalWrap* wrap = container_of(handle, SignalWrap, handle_); SignalWrap* wrap = container_of(handle, SignalWrap, handle_);
assert(wrap); assert(wrap);
Local<Value> argv[1] = { Integer::New(signum, node_isolate) }; Local<Value> argv[1] = { Integer::New(signum) };
MakeCallback(wrap->object_, onsignal_sym, ARRAY_SIZE(argv), argv); MakeCallback(wrap->object_, onsignal_sym, ARRAY_SIZE(argv), argv);
} }

4
src/slab_allocator.cc

@ -71,7 +71,7 @@ void SlabAllocator::Initialize() {
static Local<Object> NewSlab(unsigned int size) { static Local<Object> NewSlab(unsigned int size) {
HandleScope scope; HandleScope scope;
Local<Value> arg = Integer::NewFromUnsigned(ROUND_UP(size, 16), node_isolate); Local<Value> arg = Integer::NewFromUnsigned(ROUND_UP(size, 16));
Local<Object> buf = Buffer::constructor_template Local<Object> buf = Buffer::constructor_template
->GetFunction() ->GetFunction()
->NewInstance(1, &arg); ->NewInstance(1, &arg);
@ -114,7 +114,7 @@ Local<Object> SlabAllocator::Shrink(Handle<Object> obj,
unsigned int size) { unsigned int size) {
HandleScope scope; HandleScope scope;
Local<Value> slab_v = obj->GetHiddenValue(slab_sym_); Local<Value> slab_v = obj->GetHiddenValue(slab_sym_);
obj->SetHiddenValue(slab_sym_, Null(node_isolate)); obj->SetHiddenValue(slab_sym_, Null());
assert(!slab_v.IsEmpty()); assert(!slab_v.IsEmpty());
assert(slab_v->IsObject()); assert(slab_v->IsObject());
Local<Object> slab = slab_v->ToObject(); Local<Object> slab = slab_v->ToObject();

40
src/stream_wrap.cc

@ -119,13 +119,13 @@ StreamWrap::StreamWrap(Handle<Object> object, uv_stream_t* stream)
Handle<Value> StreamWrap::GetFD(Local<String>, const AccessorInfo& args) { Handle<Value> StreamWrap::GetFD(Local<String>, const AccessorInfo& args) {
#if defined(_WIN32) #if defined(_WIN32)
return v8::Null(node_isolate); return v8::Null();
#else #else
HandleScope scope; HandleScope scope;
UNWRAP(StreamWrap) UNWRAP(StreamWrap)
int fd = -1; int fd = -1;
if (wrap != NULL && wrap->stream_ != NULL) fd = wrap->stream_->io_watcher.fd; if (wrap != NULL && wrap->stream_ != NULL) fd = wrap->stream_->io_watcher.fd;
return scope.Close(Integer::New(fd, node_isolate)); return scope.Close(Integer::New(fd));
#endif #endif
} }
@ -140,7 +140,7 @@ void StreamWrap::SetHandle(uv_handle_t* h) {
void StreamWrap::UpdateWriteQueueSize() { void StreamWrap::UpdateWriteQueueSize() {
HandleScope scope; HandleScope scope;
object_->Set(write_queue_size_sym, object_->Set(write_queue_size_sym,
Integer::New(stream_->write_queue_size, node_isolate)); Integer::New(stream_->write_queue_size));
} }
@ -161,7 +161,7 @@ Handle<Value> StreamWrap::ReadStart(const Arguments& args) {
// Error starting the tcp. // Error starting the tcp.
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -175,7 +175,7 @@ Handle<Value> StreamWrap::ReadStop(const Arguments& args) {
// Error starting the tcp. // Error starting the tcp.
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -199,7 +199,7 @@ static Local<Object> AcceptHandle(uv_stream_t* pipe) {
return Local<Object>(); return Local<Object>();
wrap = static_cast<WrapType*>( wrap = static_cast<WrapType*>(
wrap_obj->GetAlignedPointerFromInternalField(0)); wrap_obj->GetPointerFromInternalField(0));
handle = wrap->UVHandle(); handle = wrap->UVHandle();
if (uv_accept(pipe, reinterpret_cast<uv_stream_t*>(handle))) if (uv_accept(pipe, reinterpret_cast<uv_stream_t*>(handle)))
@ -242,8 +242,8 @@ void StreamWrap::OnReadCommon(uv_stream_t* handle, ssize_t nread,
int argc = 3; int argc = 3;
Local<Value> argv[4] = { Local<Value> argv[4] = {
slab, slab,
Integer::NewFromUnsigned(buf.base - Buffer::Data(slab), node_isolate), Integer::NewFromUnsigned(buf.base - Buffer::Data(slab)),
Integer::NewFromUnsigned(nread, node_isolate) Integer::NewFromUnsigned(nread)
}; };
Local<Object> pending_obj; Local<Object> pending_obj;
@ -310,7 +310,7 @@ Handle<Value> StreamWrap::WriteBuffer(const Arguments& args) {
req_wrap->Dispatched(); req_wrap->Dispatched();
req_wrap->object_->Set(bytes_sym, req_wrap->object_->Set(bytes_sym,
Integer::NewFromUnsigned(length, node_isolate)); Integer::NewFromUnsigned(length));
wrap->UpdateWriteQueueSize(); wrap->UpdateWriteQueueSize();
@ -318,7 +318,7 @@ Handle<Value> StreamWrap::WriteBuffer(const Arguments& args) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
req_wrap->~WriteWrap(); req_wrap->~WriteWrap();
delete[] storage; delete[] storage;
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} else { } else {
if (wrap->stream_->type == UV_TCP) { if (wrap->stream_->type == UV_TCP) {
NODE_COUNT_NET_BYTES_SENT(length); NODE_COUNT_NET_BYTES_SENT(length);
@ -381,7 +381,7 @@ Handle<Value> StreamWrap::WriteStringImpl(const Arguments& args) {
uv_err_t err; uv_err_t err;
err.code = UV_ENOBUFS; err.code = UV_ENOBUFS;
SetErrno(err); SetErrno(err);
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} }
char* storage = new char[sizeof(WriteWrap) + storage_size + 15]; char* storage = new char[sizeof(WriteWrap) + storage_size + 15];
@ -436,7 +436,7 @@ Handle<Value> StreamWrap::WriteStringImpl(const Arguments& args) {
Local<Object> send_handle_obj = args[1]->ToObject(); Local<Object> send_handle_obj = args[1]->ToObject();
assert(send_handle_obj->InternalFieldCount() > 0); assert(send_handle_obj->InternalFieldCount() > 0);
HandleWrap* send_handle_wrap = static_cast<HandleWrap*>( HandleWrap* send_handle_wrap = static_cast<HandleWrap*>(
send_handle_obj->GetAlignedPointerFromInternalField(0)); send_handle_obj->GetPointerFromInternalField(0));
send_handle = send_handle_wrap->GetHandle(); send_handle = send_handle_wrap->GetHandle();
// Reference StreamWrap instance to prevent it from being garbage // Reference StreamWrap instance to prevent it from being garbage
@ -465,7 +465,7 @@ Handle<Value> StreamWrap::WriteStringImpl(const Arguments& args) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
req_wrap->~WriteWrap(); req_wrap->~WriteWrap();
delete[] storage; delete[] storage;
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} else { } else {
if (wrap->stream_->type == UV_TCP) { if (wrap->stream_->type == UV_TCP) {
NODE_COUNT_NET_BYTES_SENT(buf.len); NODE_COUNT_NET_BYTES_SENT(buf.len);
@ -515,9 +515,9 @@ void StreamWrap::AfterWrite(uv_write_t* req, int status) {
wrap->UpdateWriteQueueSize(); wrap->UpdateWriteQueueSize();
Local<Value> argv[] = { Local<Value> argv[] = {
Integer::New(status, node_isolate), Integer::New(status),
Local<Value>::New(node_isolate, wrap->object_), Local<Value>::New(wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_) Local<Value>::New(req_wrap->object_)
}; };
MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv); MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv);
@ -541,7 +541,7 @@ Handle<Value> StreamWrap::Shutdown(const Arguments& args) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap; delete req_wrap;
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} else { } else {
return scope.Close(req_wrap->object_); return scope.Close(req_wrap->object_);
} }
@ -563,9 +563,9 @@ void StreamWrap::AfterShutdown(uv_shutdown_t* req, int status) {
} }
Local<Value> argv[3] = { Local<Value> argv[3] = {
Integer::New(status, node_isolate), Integer::New(status),
Local<Value>::New(node_isolate, wrap->object_), Local<Value>::New(wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_) Local<Value>::New(req_wrap->object_)
}; };
MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv); MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv);

42
src/tcp_wrap.cc

@ -130,7 +130,7 @@ void TCPWrap::Initialize(Handle<Object> target) {
TCPWrap* TCPWrap::Unwrap(Local<Object> obj) { TCPWrap* TCPWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty()); assert(!obj.IsEmpty());
assert(obj->InternalFieldCount() > 0); assert(obj->InternalFieldCount() > 0);
return static_cast<TCPWrap*>(obj->GetAlignedPointerFromInternalField(0)); return static_cast<TCPWrap*>(obj->GetPointerFromInternalField(0));
} }
@ -180,7 +180,7 @@ Handle<Value> TCPWrap::GetSockName(const Arguments& args) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return Null(node_isolate); return Null();
} }
const sockaddr* addr = reinterpret_cast<const sockaddr*>(&address); const sockaddr* addr = reinterpret_cast<const sockaddr*>(&address);
@ -201,7 +201,7 @@ Handle<Value> TCPWrap::GetPeerName(const Arguments& args) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return Null(node_isolate); return Null();
} }
const sockaddr* addr = reinterpret_cast<const sockaddr*>(&address); const sockaddr* addr = reinterpret_cast<const sockaddr*>(&address);
@ -219,7 +219,7 @@ Handle<Value> TCPWrap::SetNoDelay(const Arguments& args) {
if (r) if (r)
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return Undefined(node_isolate); return Undefined();
} }
@ -235,7 +235,7 @@ Handle<Value> TCPWrap::SetKeepAlive(const Arguments& args) {
if (r) if (r)
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return Undefined(node_isolate); return Undefined();
} }
@ -251,7 +251,7 @@ Handle<Value> TCPWrap::SetSimultaneousAccepts(const Arguments& args) {
if (r) if (r)
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return Undefined(node_isolate); return Undefined();
} }
#endif #endif
@ -270,7 +270,7 @@ Handle<Value> TCPWrap::Bind(const Arguments& args) {
// Error starting the tcp. // Error starting the tcp.
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -288,7 +288,7 @@ Handle<Value> TCPWrap::Bind6(const Arguments& args) {
// Error starting the tcp. // Error starting the tcp.
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -304,7 +304,7 @@ Handle<Value> TCPWrap::Listen(const Arguments& args) {
// Error starting the tcp. // Error starting the tcp.
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -327,7 +327,7 @@ void TCPWrap::OnConnection(uv_stream_t* handle, int status) {
// Unwrap the client javascript object. // Unwrap the client javascript object.
assert(client_obj->InternalFieldCount() > 0); assert(client_obj->InternalFieldCount() > 0);
TCPWrap* client_wrap = static_cast<TCPWrap*>( TCPWrap* client_wrap = static_cast<TCPWrap*>(
client_obj->GetAlignedPointerFromInternalField(0)); client_obj->GetPointerFromInternalField(0));
if (uv_accept(handle, (uv_stream_t*)&client_wrap->handle_)) return; if (uv_accept(handle, (uv_stream_t*)&client_wrap->handle_)) return;
@ -335,7 +335,7 @@ void TCPWrap::OnConnection(uv_stream_t* handle, int status) {
argv[0] = client_obj; argv[0] = client_obj;
} else { } else {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
argv[0] = Local<Value>::New(node_isolate, Null(node_isolate)); argv[0] = Local<Value>::New(Null());
} }
MakeCallback(wrap->object_, onconnection_sym, ARRAY_SIZE(argv), argv); MakeCallback(wrap->object_, onconnection_sym, ARRAY_SIZE(argv), argv);
@ -357,11 +357,11 @@ void TCPWrap::AfterConnect(uv_connect_t* req, int status) {
} }
Local<Value> argv[5] = { Local<Value> argv[5] = {
Integer::New(status, node_isolate), Integer::New(status),
Local<Value>::New(node_isolate, wrap->object_), Local<Value>::New(wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_), Local<Value>::New(req_wrap->object_),
Local<Value>::New(node_isolate, v8::True(node_isolate)), Local<Value>::New(v8::True()),
Local<Value>::New(node_isolate, v8::True(node_isolate)) Local<Value>::New(v8::True())
}; };
MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv); MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv);
@ -393,7 +393,7 @@ Handle<Value> TCPWrap::Connect(const Arguments& args) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap; delete req_wrap;
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} else { } else {
return scope.Close(req_wrap->object_); return scope.Close(req_wrap->object_);
} }
@ -420,7 +420,7 @@ Handle<Value> TCPWrap::Connect6(const Arguments& args) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap; delete req_wrap;
return scope.Close(v8::Null(node_isolate)); return scope.Close(v8::Null());
} else { } else {
return scope.Close(req_wrap->object_); return scope.Close(req_wrap->object_);
} }
@ -458,7 +458,7 @@ Local<Object> AddressToJS(const sockaddr* addr) {
port = ntohs(a6->sin6_port); port = ntohs(a6->sin6_port);
info->Set(address_sym, String::New(ip)); info->Set(address_sym, String::New(ip));
info->Set(family_sym, ipv6_sym); info->Set(family_sym, ipv6_sym);
info->Set(port_sym, Integer::New(port, node_isolate)); info->Set(port_sym, Integer::New(port));
break; break;
case AF_INET: case AF_INET:
@ -467,11 +467,11 @@ Local<Object> AddressToJS(const sockaddr* addr) {
port = ntohs(a4->sin_port); port = ntohs(a4->sin_port);
info->Set(address_sym, String::New(ip)); info->Set(address_sym, String::New(ip));
info->Set(family_sym, ipv4_sym); info->Set(family_sym, ipv4_sym);
info->Set(port_sym, Integer::New(port, node_isolate)); info->Set(port_sym, Integer::New(port));
break; break;
default: default:
info->Set(address_sym, String::Empty(node_isolate)); info->Set(address_sym, String::Empty());
} }
return scope.Close(info); return scope.Close(info);

12
src/timer_wrap.cc

@ -102,7 +102,7 @@ class TimerWrap : public HandleWrap {
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
static Handle<Value> Stop(const Arguments& args) { static Handle<Value> Stop(const Arguments& args) {
@ -114,7 +114,7 @@ class TimerWrap : public HandleWrap {
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
static Handle<Value> Again(const Arguments& args) { static Handle<Value> Again(const Arguments& args) {
@ -126,7 +126,7 @@ class TimerWrap : public HandleWrap {
if (r) SetErrno(uv_last_error(uv_default_loop())); if (r) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
static Handle<Value> SetRepeat(const Arguments& args) { static Handle<Value> SetRepeat(const Arguments& args) {
@ -138,7 +138,7 @@ class TimerWrap : public HandleWrap {
uv_timer_set_repeat(&wrap->handle_, repeat); uv_timer_set_repeat(&wrap->handle_, repeat);
return scope.Close(Integer::New(0, node_isolate)); return scope.Close(Integer::New(0));
} }
static Handle<Value> GetRepeat(const Arguments& args) { static Handle<Value> GetRepeat(const Arguments& args) {
@ -150,7 +150,7 @@ class TimerWrap : public HandleWrap {
if (repeat < 0) SetErrno(uv_last_error(uv_default_loop())); if (repeat < 0) SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(repeat, node_isolate)); return scope.Close(Integer::New(repeat));
} }
static void OnTimeout(uv_timer_t* handle, int status) { static void OnTimeout(uv_timer_t* handle, int status) {
@ -159,7 +159,7 @@ class TimerWrap : public HandleWrap {
TimerWrap* wrap = static_cast<TimerWrap*>(handle->data); TimerWrap* wrap = static_cast<TimerWrap*>(handle->data);
assert(wrap); assert(wrap);
Local<Value> argv[1] = { Integer::New(status, node_isolate) }; Local<Value> argv[1] = { Integer::New(status) };
MakeCallback(wrap->object_, ontimeout_sym, ARRAY_SIZE(argv), argv); MakeCallback(wrap->object_, ontimeout_sym, ARRAY_SIZE(argv), argv);
} }

16
src/tty_wrap.cc

@ -88,7 +88,7 @@ void TTYWrap::Initialize(Handle<Object> target) {
TTYWrap* TTYWrap::Unwrap(Local<Object> obj) { TTYWrap* TTYWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty()); assert(!obj.IsEmpty());
assert(obj->InternalFieldCount() > 0); assert(obj->InternalFieldCount() > 0);
return static_cast<TTYWrap*>(obj->GetAlignedPointerFromInternalField(0)); return static_cast<TTYWrap*>(obj->GetPointerFromInternalField(0));
} }
@ -119,7 +119,7 @@ Handle<Value> TTYWrap::GuessHandleType(const Arguments& args) {
default: default:
assert(0); assert(0);
return v8::Undefined(node_isolate); return v8::Undefined();
} }
} }
@ -130,10 +130,10 @@ Handle<Value> TTYWrap::IsTTY(const Arguments& args) {
assert(fd >= 0); assert(fd >= 0);
if (uv_guess_handle(fd) == UV_TTY) { if (uv_guess_handle(fd) == UV_TTY) {
return v8::True(node_isolate); return v8::True();
} }
return v8::False(node_isolate); return v8::False();
} }
@ -147,12 +147,12 @@ Handle<Value> TTYWrap::GetWindowSize(const Arguments& args) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return v8::Undefined(node_isolate); return v8::Undefined();
} }
Local<v8::Array> a = v8::Array::New(2); Local<v8::Array> a = v8::Array::New(2);
a->Set(0, Integer::New(width, node_isolate)); a->Set(0, Integer::New(width));
a->Set(1, Integer::New(height, node_isolate)); a->Set(1, Integer::New(height));
return scope.Close(a); return scope.Close(a);
} }
@ -169,7 +169,7 @@ Handle<Value> TTYWrap::SetRawMode(const Arguments& args) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
} }
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }

39
src/udp_wrap.cc

@ -35,16 +35,19 @@ namespace node {
using v8::AccessorInfo; using v8::AccessorInfo;
using v8::Arguments; using v8::Arguments;
using v8::False;
using v8::Function; using v8::Function;
using v8::FunctionTemplate; using v8::FunctionTemplate;
using v8::Handle; using v8::Handle;
using v8::HandleScope; using v8::HandleScope;
using v8::Integer; using v8::Integer;
using v8::Local; using v8::Local;
using v8::Null;
using v8::Object; using v8::Object;
using v8::Persistent; using v8::Persistent;
using v8::PropertyAttribute; using v8::PropertyAttribute;
using v8::String; using v8::String;
using v8::True;
using v8::Value; using v8::Value;
typedef ReqWrap<uv_udp_send_t> SendWrap; typedef ReqWrap<uv_udp_send_t> SendWrap;
@ -138,12 +141,12 @@ Handle<Value> UDPWrap::New(const Arguments& args) {
Handle<Value> UDPWrap::GetFD(Local<String>, const AccessorInfo& args) { Handle<Value> UDPWrap::GetFD(Local<String>, const AccessorInfo& args) {
#if defined(_WIN32) #if defined(_WIN32)
return v8::Null(node_isolate); return v8::Null();
#else #else
HandleScope scope; HandleScope scope;
UNWRAP(UDPWrap) UNWRAP(UDPWrap)
int fd = (wrap == NULL) ? -1 : wrap->handle_.io_watcher.fd; int fd = (wrap == NULL) ? -1 : wrap->handle_.io_watcher.fd;
return scope.Close(Integer::New(fd, node_isolate)); return scope.Close(Integer::New(fd));
#endif #endif
} }
@ -176,7 +179,7 @@ Handle<Value> UDPWrap::DoBind(const Arguments& args, int family) {
if (r) if (r)
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -198,7 +201,7 @@ Handle<Value> UDPWrap::Bind6(const Arguments& args) {
int flag = args[0]->Int32Value(); \ int flag = args[0]->Int32Value(); \
int r = fn(&wrap->handle_, flag); \ int r = fn(&wrap->handle_, flag); \
if (r) SetErrno(uv_last_error(uv_default_loop())); \ if (r) SetErrno(uv_last_error(uv_default_loop())); \
return scope.Close(Integer::New(r, node_isolate)); \ return scope.Close(Integer::New(r)); \
} }
X(SetTTL, uv_udp_set_ttl) X(SetTTL, uv_udp_set_ttl)
@ -230,7 +233,7 @@ Handle<Value> UDPWrap::SetMembership(const Arguments& args,
if (r) if (r)
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -289,7 +292,7 @@ Handle<Value> UDPWrap::DoSend(const Arguments& args, int family) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap; delete req_wrap;
return Null(node_isolate); return Null();
} }
else { else {
return scope.Close(req_wrap->object_); return scope.Close(req_wrap->object_);
@ -316,10 +319,10 @@ Handle<Value> UDPWrap::RecvStart(const Arguments& args) {
int r = uv_udp_recv_start(&wrap->handle_, OnAlloc, OnRecv); int r = uv_udp_recv_start(&wrap->handle_, OnAlloc, OnRecv);
if (r && uv_last_error(uv_default_loop()).code != UV_EALREADY) { if (r && uv_last_error(uv_default_loop()).code != UV_EALREADY) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return False(node_isolate); return False();
} }
return True(node_isolate); return True();
} }
@ -330,7 +333,7 @@ Handle<Value> UDPWrap::RecvStop(const Arguments& args) {
int r = uv_udp_recv_stop(&wrap->handle_); int r = uv_udp_recv_stop(&wrap->handle_);
return scope.Close(Integer::New(r, node_isolate)); return scope.Close(Integer::New(r));
} }
@ -347,7 +350,7 @@ Handle<Value> UDPWrap::GetSockName(const Arguments& args) {
if (r) { if (r) {
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
return Null(node_isolate); return Null();
} }
const sockaddr* addr = reinterpret_cast<const sockaddr*>(&address); const sockaddr* addr = reinterpret_cast<const sockaddr*>(&address);
@ -372,9 +375,9 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
} }
Local<Value> argv[4] = { Local<Value> argv[4] = {
Integer::New(status, node_isolate), Integer::New(status),
Local<Value>::New(node_isolate, wrap->object_), Local<Value>::New(wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_), Local<Value>::New(req_wrap->object_),
req_wrap->object_->GetHiddenValue(buffer_sym), req_wrap->object_->GetHiddenValue(buffer_sym),
}; };
@ -404,17 +407,17 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
if (nread == 0) return; if (nread == 0) return;
if (nread < 0) { if (nread < 0) {
Local<Value> argv[] = { Local<Object>::New(node_isolate, wrap->object_) }; Local<Value> argv[] = { Local<Object>::New(wrap->object_) };
SetErrno(uv_last_error(uv_default_loop())); SetErrno(uv_last_error(uv_default_loop()));
MakeCallback(wrap->object_, onmessage_sym, ARRAY_SIZE(argv), argv); MakeCallback(wrap->object_, onmessage_sym, ARRAY_SIZE(argv), argv);
return; return;
} }
Local<Value> argv[] = { Local<Value> argv[] = {
Local<Object>::New(node_isolate, wrap->object_), Local<Object>::New(wrap->object_),
slab, slab,
Integer::NewFromUnsigned(buf.base - Buffer::Data(slab), node_isolate), Integer::NewFromUnsigned(buf.base - Buffer::Data(slab)),
Integer::NewFromUnsigned(nread, node_isolate), Integer::NewFromUnsigned(nread),
AddressToJS(addr) AddressToJS(addr)
}; };
MakeCallback(wrap->object_, onmessage_sym, ARRAY_SIZE(argv), argv); MakeCallback(wrap->object_, onmessage_sym, ARRAY_SIZE(argv), argv);
@ -424,7 +427,7 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
UDPWrap* UDPWrap::Unwrap(Local<Object> obj) { UDPWrap* UDPWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty()); assert(!obj.IsEmpty());
assert(obj->InternalFieldCount() > 0); assert(obj->InternalFieldCount() > 0);
return static_cast<UDPWrap*>(obj->GetAlignedPointerFromInternalField(0)); return static_cast<UDPWrap*>(obj->GetPointerFromInternalField(0));
} }

10
src/v8_typed_array.cc

@ -108,7 +108,7 @@ class ArrayBuffer {
if (!buf) if (!buf)
return ThrowError("Unable to allocate ArrayBuffer."); return ThrowError("Unable to allocate ArrayBuffer.");
args.This()->SetAlignedPointerInInternalField(0, buf); args.This()->SetPointerInInternalField(0, buf);
args.This()->Set(v8::String::New("byteLength"), args.This()->Set(v8::String::New("byteLength"),
v8::Integer::NewFromUnsigned(num_bytes), v8::Integer::NewFromUnsigned(num_bytes),
@ -159,8 +159,8 @@ class ArrayBuffer {
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
void* src = args.This()->GetAlignedPointerFromInternalField(0); void* src = args.This()->GetPointerFromInternalField(0);
void* dest = buffer->GetAlignedPointerFromInternalField(0); void* dest = buffer->GetPointerFromInternalField(0);
memcpy(dest, static_cast<char*>(src) + begin, slice_length); memcpy(dest, static_cast<char*>(src) + begin, slice_length);
return buffer; return buffer;
@ -298,7 +298,7 @@ class TypedArray {
GetFunction()->NewInstance(1, argv); GetFunction()->NewInstance(1, argv);
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
void* buf = buffer->GetAlignedPointerFromInternalField(0); void* buf = buffer->GetPointerFromInternalField(0);
args.This()->SetIndexedPropertiesToExternalArrayData( args.This()->SetIndexedPropertiesToExternalArrayData(
buf, TEAType, length); buf, TEAType, length);
// TODO(deanm): check for failure. // TODO(deanm): check for failure.
@ -327,7 +327,7 @@ class TypedArray {
GetFunction()->NewInstance(1, argv); GetFunction()->NewInstance(1, argv);
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
void* buf = buffer->GetAlignedPointerFromInternalField(0); void* buf = buffer->GetPointerFromInternalField(0);
args.This()->SetIndexedPropertiesToExternalArrayData( args.This()->SetIndexedPropertiesToExternalArrayData(
buf, TEAType, length); buf, TEAType, length);
// TODO(deanm): check for failure. // TODO(deanm): check for failure.

10
test/message/stack_overflow.out

@ -4,13 +4,3 @@ before
function stackOverflow() { function stackOverflow() {
^ ^
RangeError: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded
at stackOverflow (*test/message/stack_overflow.js:31:23)
at stackOverflow (*test/message/stack_overflow.js:32:3)
at stackOverflow (*test/message/stack_overflow.js:32:3)
at stackOverflow (*test/message/stack_overflow.js:32:3)
at stackOverflow (*test/message/stack_overflow.js:32:3)
at stackOverflow (*test/message/stack_overflow.js:32:3)
at stackOverflow (*test/message/stack_overflow.js:32:3)
at stackOverflow (*test/message/stack_overflow.js:32:3)
at stackOverflow (*test/message/stack_overflow.js:32:3)
at stackOverflow (*test/message/stack_overflow.js:32:3)

Loading…
Cancel
Save