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));
Local<String> address = String::New(ip);
addresses->Set(Integer::New(i, node_isolate), address);
addresses->Set(Integer::New(i), address);
}
return scope.Close(addresses);
@ -216,7 +216,7 @@ static Local<Array> HostentToNames(struct hostent* host) {
for (int i = 0; host->h_aliases[i]; ++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);
@ -337,13 +337,13 @@ class QueryWrap {
void CallOnComplete(Local<Value> answer) {
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);
}
void CallOnComplete(Local<Value> answer, Local<Value> family) {
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);
}
@ -352,7 +352,7 @@ class QueryWrap {
SetAresErrno(status);
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);
}
@ -492,8 +492,8 @@ class QueryMxWrap: public QueryWrap {
Local<Object> mx_record = Object::New();
mx_record->Set(exchange_symbol, String::New(mx_current->host));
mx_record->Set(priority_symbol,
Integer::New(mx_current->priority, node_isolate));
mx_records->Set(Integer::New(i++, node_isolate), mx_record);
Integer::New(mx_current->priority));
mx_records->Set(Integer::New(i++), mx_record);
}
ares_free_data(mx_start);
@ -550,7 +550,7 @@ class QueryTxtWrap: public QueryWrap {
struct ares_txt_reply *current = txt_out;
for (int i = 0; current; ++i, current = current->next) {
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);
@ -595,12 +595,12 @@ class QuerySrvWrap: public QueryWrap {
Local<Object> srv_record = Object::New();
srv_record->Set(name_symbol, String::New(srv_current->host));
srv_record->Set(port_symbol,
Integer::New(srv_current->port, node_isolate));
Integer::New(srv_current->port));
srv_record->Set(priority_symbol,
Integer::New(srv_current->priority, node_isolate));
Integer::New(srv_current->priority));
srv_record->Set(weight_symbol,
Integer::New(srv_current->weight, node_isolate));
srv_records->Set(Integer::New(i++, node_isolate), srv_record);
Integer::New(srv_current->weight));
srv_records->Set(Integer::New(i++), srv_record);
}
ares_free_data(srv_start);
@ -656,7 +656,7 @@ class GetHostByNameWrap: public QueryWrap {
HandleScope scope;
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);
}
@ -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
// callback from the wrap->Send stack. This will destroy the wrap's internal
// 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]);
@ -685,7 +685,7 @@ static Handle<Value> Query(const Arguments& args) {
if (r) {
SetAresErrno(r);
delete wrap;
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
} else {
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
// callback from the wrap->Send stack. This will destroy the wrap's internal
// 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]);
int family = args[1]->Int32Value();
@ -715,7 +715,7 @@ static Handle<Value> QueryWithFamily(const Arguments& args) {
if (r) {
SetAresErrno(r);
delete wrap;
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
} else {
return scope.Close(object);
}
@ -732,7 +732,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
if (status) {
// Error
SetErrno(uv_last_error(uv_default_loop()));
argv[0] = Local<Value>::New(node_isolate, Null(node_isolate));
argv[0] = Local<Value>::New(Null());
} else {
// Success
struct addrinfo *address;
@ -824,14 +824,14 @@ static Handle<Value> IsIP(const Arguments& args) {
char address_buffer[sizeof(struct in6_addr)];
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) {
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) {
SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap;
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
} else {
return scope.Close(req_wrap->object_);
}
@ -915,11 +915,11 @@ static void Initialize(Handle<Object> target) {
NODE_SET_METHOD(target, "isIP", IsIP);
target->Set(String::NewSymbol("AF_INET"),
Integer::New(AF_INET, node_isolate));
Integer::New(AF_INET));
target->Set(String::NewSymbol("AF_INET6"),
Integer::New(AF_INET6, node_isolate));
Integer::New(AF_INET6));
target->Set(String::NewSymbol("AF_UNSPEC"),
Integer::New(AF_UNSPEC, node_isolate));
Integer::New(AF_UNSPEC));
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()));
}
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.
if (status) {
SetErrno(uv_last_error(uv_default_loop()));
eventStr = String::Empty(node_isolate);
eventStr = String::Empty();
}
else if (events & UV_RENAME) {
eventStr = String::New("rename");
@ -150,10 +150,10 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
}
Local<Value> argv[3] = {
Integer::New(status, node_isolate),
Integer::New(status),
eventStr,
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()) {
@ -172,11 +172,11 @@ Handle<Value> FSEventWrap::Close(const Arguments& args) {
// and legal, HandleWrap::Close() deals with them the same way.
assert(!args.Holder().IsEmpty());
assert(args.Holder()->InternalFieldCount() > 0);
void* ptr = args.Holder()->GetAlignedPointerFromInternalField(0);
void* ptr = args.Holder()->GetPointerFromInternalField(0);
FSEventWrap* wrap = static_cast<FSEventWrap*>(ptr);
if (wrap == NULL || wrap->initialized_ == false) {
return Undefined(node_isolate);
return Undefined();
}
wrap->initialized_ = false;

14
src/handle_wrap.cc

@ -27,7 +27,7 @@
assert(!args.Holder().IsEmpty()); \
assert(args.Holder()->InternalFieldCount() > 0); \
type* wrap = static_cast<type*>( \
args.Holder()->GetAlignedPointerFromInternalField(0));
args.Holder()->GetPointerFromInternalField(0));
namespace node {
@ -66,7 +66,7 @@ Handle<Value> HandleWrap::Ref(const Arguments& args) {
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;
}
return v8::Undefined(node_isolate);
return v8::Undefined();
}
@ -88,7 +88,7 @@ Handle<Value> HandleWrap::Close(const Arguments& args) {
HandleScope scope;
HandleWrap *wrap = static_cast<HandleWrap*>(
args.Holder()->GetAlignedPointerFromInternalField(0));
args.Holder()->GetPointerFromInternalField(0));
// guard against uninitialized handle or double close
if (wrap && wrap->handle__) {
@ -97,7 +97,7 @@ Handle<Value> HandleWrap::Close(const Arguments& args) {
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->InternalFieldCount() > 0);
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_);
}
@ -138,7 +138,7 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
// But the handle pointer should be gone.
assert(wrap->handle__ == NULL);
wrap->object_->SetAlignedPointerInInternalField(0, NULL);
wrap->object_->SetPointerInInternalField(0, NULL);
wrap->object_.Dispose();
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) {
need_tick_cb = true;
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();
obj->Set(errno_symbol, Integer::New(errorno, node_isolate));
obj->Set(errno_symbol, Integer::New(errorno));
obj->Set(code_symbol, estring);
if (path) obj->Set(errpath_symbol, String::New(path));
if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall));
@ -816,7 +816,7 @@ Local<Value> UVException(int errorno,
Local<Object> obj = e->ToObject();
// 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);
if (path) obj->Set(errpath_symbol, path_str);
if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall));
@ -877,7 +877,7 @@ Local<Value> WinapiErrnoException(int errorno,
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 (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall));
return e;
@ -930,7 +930,7 @@ MakeDomainCallback(const Handle<Object> object,
assert(!domain.IsEmpty());
if (domain->Get(disposed_symbol)->IsTrue()) {
// domain has been disposed of.
return Undefined(node_isolate);
return Undefined();
}
enter = Local<Function>::Cast(domain->Get(enter_symbol));
assert(!enter.IsEmpty());
@ -938,14 +938,14 @@ MakeDomainCallback(const Handle<Object> object,
if (try_catch.HasCaught()) {
FatalException(try_catch);
return Undefined(node_isolate);
return Undefined();
}
Local<Value> ret = callback->Call(object, argc, argv);
if (try_catch.HasCaught()) {
FatalException(try_catch);
return Undefined(node_isolate);
return Undefined();
}
exit = Local<Function>::Cast(domain->Get(exit_symbol));
@ -954,7 +954,7 @@ MakeDomainCallback(const Handle<Object> object,
if (try_catch.HasCaught()) {
FatalException(try_catch);
return Undefined(node_isolate);
return Undefined();
}
if (tick_infobox.length == 0) {
@ -968,7 +968,7 @@ MakeDomainCallback(const Handle<Object> object,
if (try_catch.HasCaught()) {
FatalException(try_catch);
return Undefined(node_isolate);
return Undefined();
}
return ret;
@ -1008,7 +1008,7 @@ MakeCallback(const Handle<Object> object,
if (try_catch.HasCaught()) {
FatalException(try_catch);
return Undefined(node_isolate);
return Undefined();
}
if (tick_infobox.length == 0) {
@ -1022,7 +1022,7 @@ MakeCallback(const Handle<Object> object,
if (try_catch.HasCaught()) {
FatalException(try_catch);
return Undefined(node_isolate);
return Undefined();
}
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_);
}
if (!len) return scope.Close(String::Empty(node_isolate));
if (!len) return scope.Close(String::Empty());
if (encoding == BINARY) {
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) {
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 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) {
HandleScope scope;
int uid = getuid();
return scope.Close(Integer::New(uid, node_isolate));
return scope.Close(Integer::New(uid));
}
static Handle<Value> GetGid(const Arguments& args) {
HandleScope scope;
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 Undefined(node_isolate);
return Undefined();
}
@ -1630,7 +1630,7 @@ static Handle<Value> SetUid(const Arguments& args) {
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();
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;
}
delete[] groups;
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);
@ -1700,7 +1700,7 @@ static Handle<Value> SetGroups(const Arguments& args) {
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 Undefined(node_isolate);
return Undefined();
}
#endif // __POSIX__
@ -1758,7 +1758,7 @@ static Handle<Value> InitGroups(const Arguments& args) {
v8::Handle<v8::Value> Exit(const v8::Arguments& args) {
HandleScope scope;
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);
if (err.code != UV_OK) {
return Undefined(node_isolate);
return Undefined();
}
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;
V8::GetHeapStatistics(&v8_heap_stats);
info->Set(heap_total_symbol,
Integer::NewFromUnsigned(v8_heap_stats.total_heap_size(),
node_isolate));
Integer::NewFromUnsigned(v8_heap_stats.total_heap_size()));
info->Set(heap_used_symbol,
Integer::NewFromUnsigned(v8_heap_stats.used_heap_size(),
node_isolate));
Integer::NewFromUnsigned(v8_heap_stats.used_heap_size()));
return scope.Close(info);
}
@ -1824,10 +1822,10 @@ Handle<Value> Kill(const Arguments& args) {
if (err.code != UV_OK) {
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
@ -1857,8 +1855,8 @@ Handle<Value> Hrtime(const v8::Arguments& args) {
}
Local<Array> tuple = Array::New(2);
tuple->Set(0, Integer::NewFromUnsigned(t / NANOS_PER_SEC, node_isolate));
tuple->Set(1, 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));
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.
// coverity[leaked_storage]
return Undefined(node_isolate);
return Undefined();
}
@ -2137,7 +2135,7 @@ static Handle<Integer> EnvQuery(Local<String> property,
#ifdef __POSIX__
String::Utf8Value key(property);
if (getenv(*key)) {
return scope.Close(Integer::New(0, node_isolate));
return scope.Close(Integer::New(0));
}
#else // _WIN32
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.
return scope.Close(Integer::New(v8::ReadOnly ||
v8::DontDelete ||
v8::DontEnum,
node_isolate));
v8::DontEnum));
} else {
return scope.Close(Integer::New(0, node_isolate));
return scope.Close(Integer::New(0));
}
}
#endif
@ -2165,9 +2162,9 @@ static Handle<Boolean> EnvDeleter(Local<String> property,
HandleScope scope;
#ifdef __POSIX__
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
return True(node_isolate);
return True();
#else
String::Value key(property);
WCHAR* key_ptr = reinterpret_cast<WCHAR*>(*key);
@ -2178,7 +2175,7 @@ static Handle<Boolean> EnvDeleter(Local<String> property,
GetLastError() != ERROR_SUCCESS;
return scope.Close(Boolean::New(rv));
}
return True(node_isolate);
return True();
#endif
}
@ -2233,14 +2230,14 @@ static Handle<Object> GetFeatures() {
Local<Object> obj = Object::New();
obj->Set(String::NewSymbol("debug"),
#if defined(DEBUG) && DEBUG
True(node_isolate)
True()
#else
False(node_isolate)
False()
#endif
);
obj->Set(String::NewSymbol("uv"), True(node_isolate));
obj->Set(String::NewSymbol("ipv6"), True(node_isolate)); // TODO ping libuv
obj->Set(String::NewSymbol("uv"), True());
obj->Set(String::NewSymbol("ipv6"), True()); // TODO ping libuv
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"),
@ -2253,7 +2250,7 @@ static Handle<Object> GetFeatures() {
static Handle<Value> DebugPortGetter(Local<String> property,
const AccessorInfo& info) {
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
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++) {
Local<String> arg = String::New(argv[i]);
arguments->Set(Integer::New(j, node_isolate), arg);
arguments->Set(Integer::New(j), arg);
}
// assign it
process->Set(String::NewSymbol("argv"), arguments);
@ -2372,7 +2369,7 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
// process.execArgv
Local<Array> execArgv = Array::New(option_end_index - 1);
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
process->Set(String::NewSymbol("execArgv"), execArgv);
@ -2389,7 +2386,7 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
Local<Object> env = envTemplate->NewInstance();
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->SetAccessor(String::New("_needImmediateCallback"),
NeedImmediateCallbackGetter,
@ -2402,22 +2399,22 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
// -p, --print
if (print_eval) {
process->Set(String::NewSymbol("_print_eval"), True(node_isolate));
process->Set(String::NewSymbol("_print_eval"), True());
}
// -i, --interactive
if (force_repl) {
process->Set(String::NewSymbol("_forceRepl"), True(node_isolate));
process->Set(String::NewSymbol("_forceRepl"), True());
}
// --no-deprecation
if (no_deprecation) {
process->Set(String::NewSymbol("noDeprecation"), True(node_isolate));
process->Set(String::NewSymbol("noDeprecation"), True());
}
// --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;
@ -2527,7 +2524,7 @@ void Load(Handle<Object> process_l) {
// Add a reference to the global object
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
InitDTrace(global);
@ -2756,7 +2753,7 @@ Handle<Value> DebugProcess(const Arguments& args) {
return ThrowException(ErrnoException(errno, "kill"));
}
return Undefined(node_isolate);
return Undefined();
}
#endif // __POSIX__
@ -2829,7 +2826,7 @@ static int RegisterDebugSignalHandler() {
static Handle<Value> DebugProcess(const Arguments& args) {
HandleScope scope;
Handle<Value> rv = Undefined(node_isolate);
Handle<Value> rv = Undefined();
DWORD pid;
HANDLE process = NULL;
HANDLE thread = NULL;
@ -2913,14 +2910,14 @@ static Handle<Value> DebugProcess(const Arguments& args) {
CloseHandle(mapping);
}
return Undefined(node_isolate);
return Undefined();
}
#endif // _WIN32
static Handle<Value> DebugPause(const Arguments& args) {
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;
}
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) {
// 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"));
assert(emit_v->IsFunction());
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;
emit->Call(process_l, 2, args);
if (try_catch.HasCaught()) {

58
src/node_buffer.cc

@ -117,7 +117,7 @@ Handle<Object> Buffer::New(Handle<String> string) {
assert(bv->IsFunction());
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);
return scope.Close(instance);
@ -127,7 +127,7 @@ Handle<Object> Buffer::New(Handle<String> string) {
Buffer* Buffer::New(size_t length) {
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);
if (b.IsEmpty()) return NULL;
@ -138,7 +138,7 @@ Buffer* Buffer::New(size_t length) {
Buffer* Buffer::New(const char* data, size_t length) {
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);
Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj);
@ -152,7 +152,7 @@ Buffer* Buffer::New(char *data, size_t length,
free_callback callback, void *hint) {
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);
Buffer *buffer = ObjectWrap::Unwrap<Buffer>(obj);
@ -229,7 +229,7 @@ void Buffer::Replace(char *data, size_t length,
handle_->SetIndexedPropertiesToExternalArrayData(data_,
kExternalUnsignedByteArray,
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])
char* src = parent->data_ + start;
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];
for (uint32_t i = 0, k = 0; k < dstlen; i += 1, k += 2) {
static const char hex[] = "0123456789abcdef";
@ -405,7 +405,7 @@ Handle<Value> Buffer::Fill(const Arguments &args) {
value,
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
if (source_end == source_start) {
return scope.Close(Integer::New(0, node_isolate));
return scope.Close(Integer::New(0));
}
if (target_start >= target_length) {
@ -457,7 +457,7 @@ Handle<Value> Buffer::Copy(const Arguments &args) {
(const void*)(source->data_ + source_start),
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) {
constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(0, node_isolate));
return scope.Close(Integer::New(0, node_isolate));
Integer::New(0));
return scope.Close(Integer::New(0));
}
if (length > 0 && offset >= buffer->length_) {
@ -502,10 +502,9 @@ Handle<Value> Buffer::Utf8Write(const Arguments &args) {
String::NO_NULL_TERMINATION));
constructor_template->GetFunction()->Set(chars_written_sym,
Integer::New(char_written,
node_isolate));
Integer::New(char_written));
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));
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;
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);
return scope.Close(val);
}
@ -584,7 +583,7 @@ Handle<Value> Buffer::HexWrite(const Arguments& args) {
}
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);
return scope.Close(val);
}
@ -606,9 +605,9 @@ Handle<Value> Buffer::HexWrite(const Arguments& args) {
}
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));
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,
Integer::New(dst - start,
node_isolate));
Integer::New(dst - start));
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);
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())
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();
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,
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) {
NODE_COUNT_SERVER_CONN_OPEN();
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> COUNTER_NET_SERVER_CONNECTION_CLOSE(const Arguments& args) {
NODE_COUNT_SERVER_CONN_CLOSE();
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> COUNTER_HTTP_SERVER_REQUEST(const Arguments& args) {
NODE_COUNT_HTTP_SERVER_REQUEST();
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> COUNTER_HTTP_SERVER_RESPONSE(const Arguments& args) {
NODE_COUNT_HTTP_SERVER_RESPONSE();
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> COUNTER_HTTP_CLIENT_REQUEST(const Arguments& args) {
NODE_COUNT_HTTP_CLIENT_REQUEST();
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> COUNTER_HTTP_CLIENT_RESPONSE(const Arguments& args) {
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);
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]);
if (!bio) return False(node_isolate);
if (!bio) return False();
String::Utf8Value passphrase(args[1]);
@ -370,7 +370,7 @@ Handle<Value> SecureContext::SetKey(const Arguments& args) {
EVP_PKEY_free(key);
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]);
if (!bio) return False(node_isolate);
if (!bio) return False();
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 True(node_isolate);
return True();
}
@ -486,7 +486,7 @@ Handle<Value> SecureContext::AddCACert(const Arguments& args) {
}
X509* x509 = LoadX509(args[0]);
if (!x509) return False(node_isolate);
if (!x509) return False();
X509_STORE_add_cert(sc->ca_store_, 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_);
}
return True(node_isolate);
return True();
}
@ -511,13 +511,13 @@ Handle<Value> SecureContext::AddCRL(const Arguments& args) {
}
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);
if (x509 == NULL) {
BIO_free(bio);
return False(node_isolate);
return False();
}
X509_STORE_add_crl(sc->ca_store_, x509);
@ -528,7 +528,7 @@ Handle<Value> SecureContext::AddCRL(const Arguments& args) {
BIO_free(bio);
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]))) {
BIO_free(bp);
return False(node_isolate);
return False();
}
X509 *x509 = PEM_read_bio_X509(bp, NULL, NULL, NULL);
if (x509 == NULL) {
BIO_free(bp);
return False(node_isolate);
return False();
}
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;
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]);
SSL_CTX_set_cipher_list(sc->ctx_, *ciphers);
return True(node_isolate);
return True();
}
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());
return True(node_isolate);
return True();
}
Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) {
@ -630,14 +630,14 @@ Handle<Value> SecureContext::SetSessionIdContext(const Arguments& args) {
return ThrowException(Exception::TypeError(message));
}
return True(node_isolate);
return True();
}
Handle<Value> SecureContext::Close(const Arguments& args) {
HandleScope scope;
SecureContext *sc = ObjectWrap::Unwrap<SecureContext>(args.Holder());
sc->FreeCTXMem();
return False(node_isolate);
return False();
}
//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 True(node_isolate);
return True();
}
@ -960,11 +960,11 @@ void Connection::SetShutdownFlags() {
int flags = SSL_get_shutdown(ssl_);
if (flags & SSL_SENT_SHUTDOWN) {
handle_->Set(String::New("sentShutdown"), True(node_isolate));
handle_->Set(String::New("sentShutdown"), True());
}
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;
// set status unsupported
p->selectedNPNProto_ = Persistent<Value>::New(False(node_isolate));
p->selectedNPNProto_ = Persistent<Value>::New(False());
return SSL_TLSEXT_ERR_OK;
}
@ -1107,7 +1107,7 @@ int Connection::SelectNextProtoCallback_(SSL *s,
switch (status) {
case OPENSSL_NPN_UNSUPPORTED:
p->selectedNPNProto_ = Persistent<Value>::New(Null(node_isolate));
p->selectedNPNProto_ = Persistent<Value>::New(Null());
break;
case OPENSSL_NPN_NEGOTIATED:
p->selectedNPNProto_ = Persistent<Value>::New(String::New(
@ -1115,7 +1115,7 @@ int Connection::SelectNextProtoCallback_(SSL *s,
));
break;
case OPENSSL_NPN_NO_OVERLAP:
p->selectedNPNProto_ = Persistent<Value>::New(False(node_isolate));
p->selectedNPNProto_ = Persistent<Value>::New(False());
break;
default:
break;
@ -1149,8 +1149,7 @@ int Connection::SelectSNIContextCallback_(SSL *s, int *ad, void* arg) {
Local<Value> argv[1] = {*p->servername_};
// Call it
Local<Value> ret = Local<Value>::New(node_isolate,
MakeCallback(p->sniObject_,
Local<Value> ret = Local<Value>::New(MakeCallback(p->sniObject_,
"onselect",
ARRAY_SIZE(argv),
argv));
@ -1321,7 +1320,7 @@ Handle<Value> Connection::EncIn(const Arguments& args) {
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);
}
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);
ss->HandleSSLError("SSL_read:ClearOut", bytes_read, kZeroIsNotAnError);
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);
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);
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->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);
}
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);
@ -1484,7 +1483,7 @@ Handle<Value> Connection::ClearIn(const Arguments& args) {
ss->HandleSSLError("SSL_write:ClearIn", bytes_written, kZeroIsAnError);
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);
if (ss->ssl_ == NULL) return Undefined(node_isolate);
if (ss->ssl_ == NULL) return Undefined();
Local<Object> info = Object::New();
X509* peer_cert = SSL_get_peer_certificate(ss->ssl_);
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++) {
memset(buf, 0, sizeof(buf));
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);
@ -1612,10 +1611,10 @@ Handle<Value> Connection::GetSession(const Arguments& 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_);
if (!sess) return Undefined(node_isolate);
if (!sess) return Undefined();
int slen = i2d_SSL_SESSION(sess, NULL);
assert(slen > 0);
@ -1629,7 +1628,7 @@ Handle<Value> Connection::GetSession(const Arguments& args) {
return scope.Close(s);
}
return Null(node_isolate);
return Null();
}
Handle<Value> Connection::SetSession(const Arguments& args) {
@ -1662,7 +1661,7 @@ Handle<Value> Connection::SetSession(const Arguments& args) {
delete [] sbuf;
if (!sess)
return Undefined(node_isolate);
return Undefined();
int r = SSL_set_session(ss->ssl_, sess);
SSL_SESSION_free(sess);
@ -1672,7 +1671,7 @@ Handle<Value> Connection::SetSession(const Arguments& args) {
return ThrowException(Exception::Error(eStr));
}
return True(node_isolate);
return True();
}
Handle<Value> Connection::LoadSession(const Arguments& args) {
@ -1696,7 +1695,7 @@ Handle<Value> Connection::LoadSession(const Arguments& args) {
ss->hello_parser_.Finish();
return True(node_isolate);
return True();
}
Handle<Value> Connection::IsSessionReused(const Arguments& args) {
@ -1705,10 +1704,10 @@ Handle<Value> Connection::IsSessionReused(const Arguments& args) {
Connection *ss = Connection::Unwrap(args);
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);
}
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);
if (ss->ssl_ == NULL) return False(node_isolate);
if (ss->ssl_ == NULL) return False();
int rv = SSL_shutdown(ss->ssl_);
ss->HandleSSLError("SSL_shutdown", rv, kZeroIsNotAnError);
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);
if (ss->ssl_ == NULL) return False(node_isolate);
if (ss->ssl_ == NULL) return False();
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);
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);
if (ss->ssl_ == NULL) return Null(node_isolate);
if (ss->ssl_ == NULL) return Null();
// XXX Do this check in JS land?
@ -1801,7 +1800,7 @@ Handle<Value> Connection::VerifyError(const Arguments& args) {
switch (x509_verify_error) {
case X509_V_OK:
return Null(node_isolate);
return Null();
case X509_V_ERR_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;
if ( ss->ssl_ == NULL ) return Undefined(node_isolate);
if ( ss->ssl_ == NULL ) return Undefined();
c = SSL_get_current_cipher(ss->ssl_);
if ( c == NULL ) return Undefined(node_isolate);
if ( c == NULL ) return Undefined();
Local<Object> info = Object::New();
const char* cipher_name = SSL_CIPHER_get_name(c);
info->Set(name_symbol, String::New(cipher_name));
@ -1947,7 +1946,7 @@ Handle<Value> Connection::Close(const Arguments& args) {
SSL_free(ss->ssl_);
ss->ssl_ = NULL;
}
return True(node_isolate);
return True();
}
#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);
if (!npn_proto) {
return False(node_isolate);
return False();
}
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());
return True(node_isolate);
return True();
};
#endif
@ -2001,7 +2000,7 @@ Handle<Value> Connection::GetServername(const Arguments& args) {
if (ss->is_server_ && !ss->servername_.IsEmpty()) {
return ss->servername_;
} 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_->Set(String::New("onselect"), args[0]);
return True(node_isolate);
return True();
}
#endif
@ -2256,7 +2255,7 @@ class Cipher : public ObjectWrap {
cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue());
return Undefined(node_isolate);
return Undefined();
}
static Handle<Value> CipherFinal(const Arguments& args) {
@ -2570,7 +2569,7 @@ class Decipher : public ObjectWrap {
cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue());
return Undefined(node_isolate);
return Undefined();
}
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]) {
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);
memset(req->key, 0, req->keylen);
} else {
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;
@ -3826,7 +3825,7 @@ Handle<Value> PBKDF2(const Arguments& args) {
&req->work_req,
EIO_PBKDF2,
EIO_PBKDF2After);
return Undefined(node_isolate);
return Undefined();
} else {
Local<Value> argv[2];
EIO_PBKDF2(req);
@ -3897,13 +3896,13 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
ERR_error_string_n(req->error_, errmsg, sizeof 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 {
// avoids the malloc + memcpy
Buffer* buffer = Buffer::New(req->data_, req->size_, RandomBytesFree, NULL);
argv[0] = Local<Value>::New(node_isolate, Null(node_isolate));
argv[1] = Local<Object>::New(node_isolate, buffer->handle_);
argv[0] = Local<Value>::New(Null());
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) {
#ifndef HAVE_SYSTEMTAP
if (!NODE_NET_SERVER_CONNECTION_ENABLED())
return Undefined(node_isolate);
return Undefined();
#endif
HandleScope scope;
@ -142,13 +142,13 @@ Handle<Value> DTRACE_NET_SERVER_CONNECTION(const Arguments& args) {
NODE_NET_SERVER_CONNECTION(&conn);
#endif
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> DTRACE_NET_STREAM_END(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP
if (!NODE_NET_STREAM_END_ENABLED())
return Undefined(node_isolate);
return Undefined();
#endif
HandleScope scope;
@ -160,13 +160,13 @@ Handle<Value> DTRACE_NET_STREAM_END(const Arguments& args) {
NODE_NET_STREAM_END(&conn);
#endif
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> DTRACE_NET_SOCKET_READ(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP
if (!NODE_NET_SOCKET_READ_ENABLED())
return Undefined(node_isolate);
return Undefined();
#endif
HandleScope scope;
@ -184,13 +184,13 @@ Handle<Value> DTRACE_NET_SOCKET_READ(const Arguments& args) {
NODE_NET_SOCKET_READ(&conn, nbytes);
#endif
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> DTRACE_NET_SOCKET_WRITE(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP
if (!NODE_NET_SOCKET_WRITE_ENABLED())
return Undefined(node_isolate);
return Undefined();
#endif
HandleScope scope;
@ -208,7 +208,7 @@ Handle<Value> DTRACE_NET_SOCKET_WRITE(const Arguments& args) {
NODE_NET_SOCKET_WRITE(&conn, nbytes);
#endif
return Undefined(node_isolate);
return Undefined();
}
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
if (!NODE_HTTP_SERVER_REQUEST_ENABLED())
return Undefined(node_isolate);
return Undefined();
#endif
HandleScope scope;
@ -249,13 +249,13 @@ Handle<Value> DTRACE_HTTP_SERVER_REQUEST(const Arguments& args) {
#else
NODE_HTTP_SERVER_REQUEST(&req, &conn);
#endif
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> DTRACE_HTTP_SERVER_RESPONSE(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP
if (!NODE_HTTP_SERVER_RESPONSE_ENABLED())
return Undefined(node_isolate);
return Undefined();
#endif
HandleScope scope;
@ -267,7 +267,7 @@ Handle<Value> DTRACE_HTTP_SERVER_RESPONSE(const Arguments& args) {
NODE_HTTP_SERVER_RESPONSE(&conn);
#endif
return Undefined(node_isolate);
return Undefined();
}
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
if (!NODE_HTTP_CLIENT_REQUEST_ENABLED())
return Undefined(node_isolate);
return Undefined();
#endif
HandleScope scope;
@ -312,13 +312,13 @@ Handle<Value> DTRACE_HTTP_CLIENT_REQUEST(const Arguments& args) {
#else
NODE_HTTP_CLIENT_REQUEST(&req, &conn);
#endif
return Undefined(node_isolate);
return Undefined();
}
Handle<Value> DTRACE_HTTP_CLIENT_RESPONSE(const Arguments& args) {
#ifndef HAVE_SYSTEMTAP
if (!NODE_HTTP_CLIENT_RESPONSE_ENABLED())
return Undefined(node_isolate);
return Undefined();
#endif
HandleScope scope;
@ -329,7 +329,7 @@ Handle<Value> DTRACE_HTTP_CLIENT_RESPONSE(const Arguments& args) {
NODE_HTTP_CLIENT_RESPONSE(&conn);
#endif
return Undefined(node_isolate);
return Undefined();
}
#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 {
// 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.
argc = 2;
@ -144,11 +144,11 @@ static void After(uv_fs_t *req) {
break;
case UV_FS_OPEN:
argv[1] = Integer::New(req->result, node_isolate);
argv[1] = Integer::New(req->result);
break;
case UV_FS_WRITE:
argv[1] = Integer::New(req->result, node_isolate);
argv[1] = Integer::New(req->result);
break;
case UV_FS_STAT:
@ -163,7 +163,7 @@ static void After(uv_fs_t *req) {
case UV_FS_READ:
// Buffer interface
argv[1] = Integer::New(req->result, node_isolate);
argv[1] = Integer::New(req->result);
break;
case UV_FS_READDIR:
@ -175,7 +175,7 @@ static void After(uv_fs_t *req) {
for (int i = 0; i < nnames; i++) {
Local<String> name = String::New(namebuf);
names->Set(Integer::New(i, node_isolate), name);
names->Set(Integer::New(i), name);
#ifndef NDEBUG
namebuf += strlen(namebuf);
assert(*namebuf == '\0');
@ -256,7 +256,7 @@ static Handle<Value> Close(const Arguments& args) {
ASYNC_CALL(close, args[1], fd)
} else {
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.
#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>(); \
stats->Set(name##_symbol, val); \
}
@ -437,7 +437,7 @@ static Handle<Value> Symlink(const Arguments& args) {
ASYNC_CALL(symlink, args[3], *dest, *path, flags)
} else {
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)
} else {
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)
} else {
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)
} else {
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)
} else {
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)
} else {
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)
} else {
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)
} else {
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)
} else {
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++) {
Local<String> name = String::New(namebuf);
names->Set(Integer::New(i, node_isolate), name);
names->Set(Integer::New(i), name);
#ifndef NDEBUG
namebuf += strlen(namebuf);
assert(*namebuf == '\0');
@ -654,7 +654,7 @@ static Handle<Value> Open(const Arguments& args) {
} else {
SYNC_CALL(open, *path, *path, flags, mode)
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)
} else {
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);
} else {
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);
}
}
@ -792,7 +792,7 @@ static Handle<Value> Chmod(const Arguments& args) {
ASYNC_CALL(chmod, args[2], *path, mode);
} else {
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);
} else {
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);
} else {
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);
} else {
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);
} else {
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);
} else {
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_)
return String::New(str_, size_);
else
return String::Empty(node_isolate);
return String::Empty();
}
@ -270,22 +270,22 @@ public:
// STATUS
if (parser_.type == HTTP_RESPONSE) {
message_info->Set(status_code_sym,
Integer::New(parser_.status_code, node_isolate));
Integer::New(parser_.status_code));
}
// VERSION
message_info->Set(version_major_sym,
Integer::New(parser_.http_major, node_isolate));
Integer::New(parser_.http_major));
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,
http_should_keep_alive(&parser_) ? True(node_isolate)
: False(node_isolate));
http_should_keep_alive(&parser_) ? True()
: False());
message_info->Set(upgrade_sym,
parser_.upgrade ? True(node_isolate)
: False(node_isolate));
parser_.upgrade ? True()
: False());
Local<Value> argv[1] = { message_info };
@ -310,8 +310,8 @@ public:
Local<Value> argv[3] = {
*current_buffer,
Integer::New(at - current_buffer_data, node_isolate),
Integer::New(length, node_isolate)
Integer::New(at - current_buffer_data),
Integer::New(length)
};
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 (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
// TODO What if there is an error on EOF?
if (!parser->parser_.upgrade && nparsed != len) {
@ -468,12 +468,12 @@ public:
Local<Value> e = Exception::Error(String::NewSymbol("Parse Error"));
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)));
return scope.Close(e);
}
return Undefined(node_isolate);
return Undefined();
}
@ -491,7 +491,7 @@ public:
Parser* parser = ObjectWrap::Unwrap<Parser>(args.This());
parser->Init(type);
return Undefined(node_isolate);
return Undefined();
}
@ -565,10 +565,10 @@ void InitHttpParser(Handle<Object> target) {
PropertyAttribute attrib = (PropertyAttribute) (ReadOnly | DontDelete);
t->Set(String::NewSymbol("REQUEST"),
Integer::New(HTTP_REQUEST, node_isolate),
Integer::New(HTTP_REQUEST),
attrib);
t->Set(String::NewSymbol("RESPONSE"),
Integer::New(HTTP_RESPONSE, node_isolate),
Integer::New(HTTP_RESPONSE),
attrib);
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()->InternalFieldCount() > 0); \
type* wrap = static_cast<type*>( \
args.Holder()->GetAlignedPointerFromInternalField(0)); \
args.Holder()->GetPointerFromInternalField(0)); \
if (!wrap) { \
fprintf(stderr, #type ": Aborting due to unwrap failure at %s:%d\n", \
__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) {
assert(!handle.IsEmpty());
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->InternalFieldCount() > 0);
handle_ = v8::Persistent<v8::Object>::New(handle);
handle_->SetAlignedPointerInInternalField(0, this);
handle_->SetPointerInInternalField(0, this);
MakeWeak();
}

24
src/node_os.cc

@ -98,7 +98,7 @@ static Handle<Value> GetOSRelease(const Arguments& args) {
info.dwOSVersionInfoSize = sizeof(info);
if (GetVersionEx(&info) == 0) {
return Undefined(node_isolate);
return Undefined();
}
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);
if (err.code != UV_OK) {
return Undefined(node_isolate);
return Undefined();
}
Local<Array> cpus = Array::New();
@ -124,20 +124,20 @@ static Handle<Value> GetCPUInfo(const Arguments& args) {
for (i = 0; i < count; i++) {
Local<Object> times_info = Object::New();
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"),
Integer::New(cpu_infos[i].cpu_times.nice, node_isolate));
Integer::New(cpu_infos[i].cpu_times.nice));
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"),
Integer::New(cpu_infos[i].cpu_times.idle, node_isolate));
Integer::New(cpu_infos[i].cpu_times.idle));
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();
cpu_info->Set(String::New("model"), String::New(cpu_infos[i].model));
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);
(*cpus)->Set(i,cpu_info);
}
@ -152,7 +152,7 @@ static Handle<Value> GetFreeMemory(const Arguments& args) {
double amount = uv_get_free_memory();
if (amount < 0) {
return Undefined(node_isolate);
return Undefined();
}
return scope.Close(Number::New(amount));
@ -163,7 +163,7 @@ static Handle<Value> GetTotalMemory(const Arguments& args) {
double amount = uv_get_total_memory();
if (amount < 0) {
return Undefined(node_isolate);
return Undefined();
}
return scope.Close(Number::New(amount));
@ -176,7 +176,7 @@ static Handle<Value> GetUptime(const Arguments& args) {
uv_err_t err = uv_uptime(&uptime);
if (err.code != UV_OK) {
return Undefined(node_isolate);
return Undefined();
}
return scope.Close(Number::New(uptime));
@ -238,7 +238,7 @@ static Handle<Value> GetInterfaceAddresses(const Arguments& args) {
const bool internal = interfaces[i].is_internal;
o->Set(String::New("internal"),
internal ? True(node_isolate) : False(node_isolate));
internal ? True() : False());
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
// that when this function exits the context will be disposed.
Persistent<Context> tmp = Context::New();
context = Local<Context>::New(node_isolate, tmp);
context = Local<Context>::New(tmp);
tmp.Dispose();
} 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];
argv[0] = BuildStatsObject(curr);
argv[1] = BuildStatsObject(prev);
argv[2] = Integer::New(status, node_isolate);
argv[2] = Integer::New(status);
if (status == -1) {
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);
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);
wrap->Stop();
return Undefined(node_isolate);
return Undefined();
}

13
src/node_zlib.cc

@ -93,7 +93,7 @@ class ZCtx : public ObjectWrap {
HandleScope scope;
ZCtx *ctx = ObjectWrap::Unwrap<ZCtx>(args.This());
ctx->Close();
return scope.Close(Undefined(node_isolate));
return scope.Close(Undefined());
}
@ -253,8 +253,8 @@ class ZCtx : public ObjectWrap {
return;
}
Local<Integer> avail_out = Integer::New(ctx->strm_.avail_out, node_isolate);
Local<Integer> avail_in = Integer::New(ctx->strm_.avail_in, node_isolate);
Local<Integer> avail_out = Integer::New(ctx->strm_.avail_out);
Local<Integer> avail_in = Integer::New(ctx->strm_.avail_in);
ctx->write_in_progress_ = false;
@ -279,8 +279,7 @@ class ZCtx : public ObjectWrap {
"Invalid error handler");
HandleScope scope;
Local<Value> args[2] = { String::New(msg),
Local<Value>::New(node_isolate,
Number::New(ctx->err_)) };
Local<Value>::New(Number::New(ctx->err_)) };
MakeCallback(ctx->handle_, onerror_sym, ARRAY_SIZE(args), args);
// no hope of rescue.
@ -342,7 +341,7 @@ class ZCtx : public ObjectWrap {
Init(ctx, level, windowBits, memLevel, strategy,
dictionary, dictionary_len);
SetDictionary(ctx);
return Undefined(node_isolate);
return Undefined();
}
static Handle<Value> Reset(const Arguments &args) {
@ -352,7 +351,7 @@ class ZCtx : public ObjectWrap {
Reset(ctx);
SetDictionary(ctx);
return Undefined(node_isolate);
return Undefined();
}
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) {
assert(!obj.IsEmpty());
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.
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);
return v8::Null(node_isolate);
return v8::Null();
}
#endif
@ -187,7 +187,7 @@ Handle<Value> PipeWrap::Listen(const Arguments& args) {
// Error starting the pipe.
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.
assert(client_obj->InternalFieldCount() > 0);
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;
@ -248,11 +248,11 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) {
}
Local<Value> argv[5] = {
Integer::New(status, node_isolate),
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_),
Local<Value>::New(node_isolate, Boolean::New(readable)),
Local<Value>::New(node_isolate, Boolean::New(writable))
Integer::New(status),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_),
Local<Value>::New(Boolean::New(readable)),
Local<Value>::New(Boolean::New(writable))
};
if (oncomplete_sym.IsEmpty()) {
@ -273,7 +273,7 @@ Handle<Value> PipeWrap::Open(const Arguments& args) {
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_);
assert(wrap->process_.data == wrap);
wrap->object_->Set(String::New("pid"),
Integer::New(wrap->process_.pid, node_isolate));
Integer::New(wrap->process_.pid));
}
if (options.args) {
@ -266,7 +266,7 @@ class ProcessWrap : public HandleWrap {
delete[] options.stdio;
return scope.Close(Integer::New(r, node_isolate));
return scope.Close(Integer::New(r));
}
static Handle<Value> Kill(const Arguments& args) {
@ -280,7 +280,7 @@ class ProcessWrap : public HandleWrap {
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) {
@ -291,7 +291,7 @@ class ProcessWrap : public HandleWrap {
assert(&wrap->process_ == handle);
Local<Value> argv[2] = {
Integer::New(exit_status, node_isolate),
Integer::New(exit_status),
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()));
return scope.Close(Integer::New(r, node_isolate));
return scope.Close(Integer::New(r));
}
static Handle<Value> Stop(const Arguments& args) {
@ -109,7 +109,7 @@ class SignalWrap : public HandleWrap {
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) {
@ -118,7 +118,7 @@ class SignalWrap : public HandleWrap {
SignalWrap* wrap = container_of(handle, SignalWrap, handle_);
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);
}

4
src/slab_allocator.cc

@ -71,7 +71,7 @@ void SlabAllocator::Initialize() {
static Local<Object> NewSlab(unsigned int size) {
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
->GetFunction()
->NewInstance(1, &arg);
@ -114,7 +114,7 @@ Local<Object> SlabAllocator::Shrink(Handle<Object> obj,
unsigned int size) {
HandleScope scope;
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->IsObject());
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) {
#if defined(_WIN32)
return v8::Null(node_isolate);
return v8::Null();
#else
HandleScope scope;
UNWRAP(StreamWrap)
int fd = -1;
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
}
@ -140,7 +140,7 @@ void StreamWrap::SetHandle(uv_handle_t* h) {
void StreamWrap::UpdateWriteQueueSize() {
HandleScope scope;
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.
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.
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>();
wrap = static_cast<WrapType*>(
wrap_obj->GetAlignedPointerFromInternalField(0));
wrap_obj->GetPointerFromInternalField(0));
handle = wrap->UVHandle();
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;
Local<Value> argv[4] = {
slab,
Integer::NewFromUnsigned(buf.base - Buffer::Data(slab), node_isolate),
Integer::NewFromUnsigned(nread, node_isolate)
Integer::NewFromUnsigned(buf.base - Buffer::Data(slab)),
Integer::NewFromUnsigned(nread)
};
Local<Object> pending_obj;
@ -310,7 +310,7 @@ Handle<Value> StreamWrap::WriteBuffer(const Arguments& args) {
req_wrap->Dispatched();
req_wrap->object_->Set(bytes_sym,
Integer::NewFromUnsigned(length, node_isolate));
Integer::NewFromUnsigned(length));
wrap->UpdateWriteQueueSize();
@ -318,7 +318,7 @@ Handle<Value> StreamWrap::WriteBuffer(const Arguments& args) {
SetErrno(uv_last_error(uv_default_loop()));
req_wrap->~WriteWrap();
delete[] storage;
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
} else {
if (wrap->stream_->type == UV_TCP) {
NODE_COUNT_NET_BYTES_SENT(length);
@ -381,7 +381,7 @@ Handle<Value> StreamWrap::WriteStringImpl(const Arguments& args) {
uv_err_t err;
err.code = UV_ENOBUFS;
SetErrno(err);
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
}
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();
assert(send_handle_obj->InternalFieldCount() > 0);
HandleWrap* send_handle_wrap = static_cast<HandleWrap*>(
send_handle_obj->GetAlignedPointerFromInternalField(0));
send_handle_obj->GetPointerFromInternalField(0));
send_handle = send_handle_wrap->GetHandle();
// 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()));
req_wrap->~WriteWrap();
delete[] storage;
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
} else {
if (wrap->stream_->type == UV_TCP) {
NODE_COUNT_NET_BYTES_SENT(buf.len);
@ -515,9 +515,9 @@ void StreamWrap::AfterWrite(uv_write_t* req, int status) {
wrap->UpdateWriteQueueSize();
Local<Value> argv[] = {
Integer::New(status, node_isolate),
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_)
Integer::New(status),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_)
};
MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv);
@ -541,7 +541,7 @@ Handle<Value> StreamWrap::Shutdown(const Arguments& args) {
if (r) {
SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap;
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
} else {
return scope.Close(req_wrap->object_);
}
@ -563,9 +563,9 @@ void StreamWrap::AfterShutdown(uv_shutdown_t* req, int status) {
}
Local<Value> argv[3] = {
Integer::New(status, node_isolate),
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_)
Integer::New(status),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_)
};
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) {
assert(!obj.IsEmpty());
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) {
SetErrno(uv_last_error(uv_default_loop()));
return Null(node_isolate);
return Null();
}
const sockaddr* addr = reinterpret_cast<const sockaddr*>(&address);
@ -201,7 +201,7 @@ Handle<Value> TCPWrap::GetPeerName(const Arguments& args) {
if (r) {
SetErrno(uv_last_error(uv_default_loop()));
return Null(node_isolate);
return Null();
}
const sockaddr* addr = reinterpret_cast<const sockaddr*>(&address);
@ -219,7 +219,7 @@ Handle<Value> TCPWrap::SetNoDelay(const Arguments& args) {
if (r)
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)
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)
SetErrno(uv_last_error(uv_default_loop()));
return Undefined(node_isolate);
return Undefined();
}
#endif
@ -270,7 +270,7 @@ Handle<Value> TCPWrap::Bind(const Arguments& args) {
// Error starting the tcp.
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.
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.
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.
assert(client_obj->InternalFieldCount() > 0);
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;
@ -335,7 +335,7 @@ void TCPWrap::OnConnection(uv_stream_t* handle, int status) {
argv[0] = client_obj;
} else {
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);
@ -357,11 +357,11 @@ void TCPWrap::AfterConnect(uv_connect_t* req, int status) {
}
Local<Value> argv[5] = {
Integer::New(status, node_isolate),
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_),
Local<Value>::New(node_isolate, v8::True(node_isolate)),
Local<Value>::New(node_isolate, v8::True(node_isolate))
Integer::New(status),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_),
Local<Value>::New(v8::True()),
Local<Value>::New(v8::True())
};
MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv);
@ -393,7 +393,7 @@ Handle<Value> TCPWrap::Connect(const Arguments& args) {
if (r) {
SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap;
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
} else {
return scope.Close(req_wrap->object_);
}
@ -420,7 +420,7 @@ Handle<Value> TCPWrap::Connect6(const Arguments& args) {
if (r) {
SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap;
return scope.Close(v8::Null(node_isolate));
return scope.Close(v8::Null());
} else {
return scope.Close(req_wrap->object_);
}
@ -458,7 +458,7 @@ Local<Object> AddressToJS(const sockaddr* addr) {
port = ntohs(a6->sin6_port);
info->Set(address_sym, String::New(ip));
info->Set(family_sym, ipv6_sym);
info->Set(port_sym, Integer::New(port, node_isolate));
info->Set(port_sym, Integer::New(port));
break;
case AF_INET:
@ -467,11 +467,11 @@ Local<Object> AddressToJS(const sockaddr* addr) {
port = ntohs(a4->sin_port);
info->Set(address_sym, String::New(ip));
info->Set(family_sym, ipv4_sym);
info->Set(port_sym, Integer::New(port, node_isolate));
info->Set(port_sym, Integer::New(port));
break;
default:
info->Set(address_sym, String::Empty(node_isolate));
info->Set(address_sym, String::Empty());
}
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()));
return scope.Close(Integer::New(r, node_isolate));
return scope.Close(Integer::New(r));
}
static Handle<Value> Stop(const Arguments& args) {
@ -114,7 +114,7 @@ class TimerWrap : public HandleWrap {
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) {
@ -126,7 +126,7 @@ class TimerWrap : public HandleWrap {
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) {
@ -138,7 +138,7 @@ class TimerWrap : public HandleWrap {
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) {
@ -150,7 +150,7 @@ class TimerWrap : public HandleWrap {
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) {
@ -159,7 +159,7 @@ class TimerWrap : public HandleWrap {
TimerWrap* wrap = static_cast<TimerWrap*>(handle->data);
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);
}

16
src/tty_wrap.cc

@ -88,7 +88,7 @@ void TTYWrap::Initialize(Handle<Object> target) {
TTYWrap* TTYWrap::Unwrap(Local<Object> obj) {
assert(!obj.IsEmpty());
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:
assert(0);
return v8::Undefined(node_isolate);
return v8::Undefined();
}
}
@ -130,10 +130,10 @@ Handle<Value> TTYWrap::IsTTY(const Arguments& args) {
assert(fd >= 0);
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) {
SetErrno(uv_last_error(uv_default_loop()));
return v8::Undefined(node_isolate);
return v8::Undefined();
}
Local<v8::Array> a = v8::Array::New(2);
a->Set(0, Integer::New(width, node_isolate));
a->Set(1, Integer::New(height, node_isolate));
a->Set(0, Integer::New(width));
a->Set(1, Integer::New(height));
return scope.Close(a);
}
@ -169,7 +169,7 @@ Handle<Value> TTYWrap::SetRawMode(const Arguments& args) {
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::Arguments;
using v8::False;
using v8::Function;
using v8::FunctionTemplate;
using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
using v8::Null;
using v8::Object;
using v8::Persistent;
using v8::PropertyAttribute;
using v8::String;
using v8::True;
using v8::Value;
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) {
#if defined(_WIN32)
return v8::Null(node_isolate);
return v8::Null();
#else
HandleScope scope;
UNWRAP(UDPWrap)
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
}
@ -176,7 +179,7 @@ Handle<Value> UDPWrap::DoBind(const Arguments& args, int family) {
if (r)
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 r = fn(&wrap->handle_, flag); \
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)
@ -230,7 +233,7 @@ Handle<Value> UDPWrap::SetMembership(const Arguments& args,
if (r)
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) {
SetErrno(uv_last_error(uv_default_loop()));
delete req_wrap;
return Null(node_isolate);
return Null();
}
else {
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);
if (r && uv_last_error(uv_default_loop()).code != UV_EALREADY) {
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_);
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) {
SetErrno(uv_last_error(uv_default_loop()));
return Null(node_isolate);
return Null();
}
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] = {
Integer::New(status, node_isolate),
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_),
Integer::New(status),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_),
req_wrap->object_->GetHiddenValue(buffer_sym),
};
@ -404,17 +407,17 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
if (nread == 0) return;
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()));
MakeCallback(wrap->object_, onmessage_sym, ARRAY_SIZE(argv), argv);
return;
}
Local<Value> argv[] = {
Local<Object>::New(node_isolate, wrap->object_),
Local<Object>::New(wrap->object_),
slab,
Integer::NewFromUnsigned(buf.base - Buffer::Data(slab), node_isolate),
Integer::NewFromUnsigned(nread, node_isolate),
Integer::NewFromUnsigned(buf.base - Buffer::Data(slab)),
Integer::NewFromUnsigned(nread),
AddressToJS(addr)
};
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) {
assert(!obj.IsEmpty());
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)
return ThrowError("Unable to allocate ArrayBuffer.");
args.This()->SetAlignedPointerInInternalField(0, buf);
args.This()->SetPointerInInternalField(0, buf);
args.This()->Set(v8::String::New("byteLength"),
v8::Integer::NewFromUnsigned(num_bytes),
@ -159,8 +159,8 @@ class ArrayBuffer {
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
void* src = args.This()->GetAlignedPointerFromInternalField(0);
void* dest = buffer->GetAlignedPointerFromInternalField(0);
void* src = args.This()->GetPointerFromInternalField(0);
void* dest = buffer->GetPointerFromInternalField(0);
memcpy(dest, static_cast<char*>(src) + begin, slice_length);
return buffer;
@ -298,7 +298,7 @@ class TypedArray {
GetFunction()->NewInstance(1, argv);
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
void* buf = buffer->GetAlignedPointerFromInternalField(0);
void* buf = buffer->GetPointerFromInternalField(0);
args.This()->SetIndexedPropertiesToExternalArrayData(
buf, TEAType, length);
// TODO(deanm): check for failure.
@ -327,7 +327,7 @@ class TypedArray {
GetFunction()->NewInstance(1, argv);
if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed
void* buf = buffer->GetAlignedPointerFromInternalField(0);
void* buf = buffer->GetPointerFromInternalField(0);
args.This()->SetIndexedPropertiesToExternalArrayData(
buf, TEAType, length);
// TODO(deanm): check for failure.

10
test/message/stack_overflow.out

@ -4,13 +4,3 @@ before
function stackOverflow() {
^
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