From 6573fc35022b783d1f93b79dbf127cf2b6c8fc23 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 6 Jan 2013 23:33:09 +0100 Subject: [PATCH] src: pass node_isolate to Integer::New --- src/cares_wrap.cc | 45 ++++++++++++++++++++++---------------- src/fs_event_wrap.cc | 4 ++-- src/node.cc | 47 +++++++++++++++++++++------------------- src/node_buffer.cc | 40 ++++++++++++++++++---------------- src/node_crypto.cc | 24 ++++++++++---------- src/node_file.cc | 18 +++++++-------- src/node_http_parser.cc | 25 +++++++++++++-------- src/node_os.cc | 13 ++++++----- src/node_stat_watcher.cc | 2 +- src/node_zlib.cc | 4 ++-- src/pipe_wrap.cc | 6 ++--- src/process_wrap.cc | 9 ++++---- src/signal_wrap.cc | 6 ++--- src/slab_allocator.cc | 2 +- src/stream_wrap.cc | 15 +++++++------ src/tcp_wrap.cc | 12 +++++----- src/timer_wrap.cc | 12 +++++----- src/tty_wrap.cc | 6 ++--- src/udp_wrap.cc | 16 +++++++------- src/v8_typed_array.cc | 36 +++++++++++++++--------------- 20 files changed, 183 insertions(+), 159 deletions(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 60378a5103..bf2f643a75 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -203,7 +203,7 @@ static Local HostentToAddresses(struct hostent* host) { uv_inet_ntop(host->h_addrtype, host->h_addr_list[i], ip, sizeof(ip)); Local address = String::New(ip); - addresses->Set(Integer::New(i), address); + addresses->Set(Integer::New(i, node_isolate), address); } return scope.Close(addresses); @@ -216,7 +216,7 @@ static Local HostentToNames(struct hostent* host) { for (int i = 0; host->h_aliases[i]; ++i) { Local address = String::New(host->h_aliases[i]); - names->Set(Integer::New(i), address); + names->Set(Integer::New(i, node_isolate), address); } return scope.Close(names); @@ -337,13 +337,13 @@ class QueryWrap { void CallOnComplete(Local answer) { HandleScope scope; - Local argv[2] = { Integer::New(0), answer }; + Local argv[2] = { Integer::New(0, node_isolate), answer }; MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv); } void CallOnComplete(Local answer, Local family) { HandleScope scope; - Local argv[3] = { Integer::New(0), answer, family }; + Local argv[3] = { Integer::New(0, node_isolate), answer, family }; MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv); } @@ -352,7 +352,7 @@ class QueryWrap { SetAresErrno(status); HandleScope scope; - Local argv[1] = { Integer::New(-1) }; + Local argv[1] = { Integer::New(-1, node_isolate) }; MakeCallback(object_, oncomplete_sym, ARRAY_SIZE(argv), argv); } @@ -491,8 +491,9 @@ class QueryMxWrap: public QueryWrap { mx_current = mx_current->next) { Local mx_record = Object::New(); mx_record->Set(exchange_symbol, String::New(mx_current->host)); - mx_record->Set(priority_symbol, Integer::New(mx_current->priority)); - mx_records->Set(Integer::New(i++), mx_record); + mx_record->Set(priority_symbol, + Integer::New(mx_current->priority, node_isolate)); + mx_records->Set(Integer::New(i++, node_isolate), mx_record); } ares_free_data(mx_start); @@ -549,7 +550,7 @@ class QueryTxtWrap: public QueryWrap { struct ares_txt_reply *current = txt_out; for (int i = 0; current; ++i, current = current->next) { Local txt = String::New(reinterpret_cast(current->txt)); - txt_records->Set(Integer::New(i), txt); + txt_records->Set(Integer::New(i, node_isolate), txt); } ares_free_data(txt_out); @@ -593,10 +594,13 @@ class QuerySrvWrap: public QueryWrap { srv_current = srv_current->next) { Local srv_record = Object::New(); srv_record->Set(name_symbol, String::New(srv_current->host)); - srv_record->Set(port_symbol, Integer::New(srv_current->port)); - srv_record->Set(priority_symbol, Integer::New(srv_current->priority)); - srv_record->Set(weight_symbol, Integer::New(srv_current->weight)); - srv_records->Set(Integer::New(i++), srv_record); + srv_record->Set(port_symbol, + Integer::New(srv_current->port, node_isolate)); + srv_record->Set(priority_symbol, + Integer::New(srv_current->priority, node_isolate)); + srv_record->Set(weight_symbol, + Integer::New(srv_current->weight, node_isolate)); + srv_records->Set(Integer::New(i++, node_isolate), srv_record); } ares_free_data(srv_start); @@ -652,7 +656,7 @@ class GetHostByNameWrap: public QueryWrap { HandleScope scope; Local addresses = HostentToAddresses(host); - Local family = Integer::New(host->h_addrtype); + Local family = Integer::New(host->h_addrtype, node_isolate); this->CallOnComplete(addresses, family); } @@ -820,14 +824,14 @@ static Handle 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)); + return scope.Close(v8::Integer::New(4, node_isolate)); } if (uv_inet_pton(AF_INET6, *ip, &address_buffer).code == UV_OK) { - return scope.Close(v8::Integer::New(6)); + return scope.Close(v8::Integer::New(6, node_isolate)); } - return scope.Close(v8::Integer::New(0)); + return scope.Close(v8::Integer::New(0, node_isolate)); } @@ -906,9 +910,12 @@ static void Initialize(Handle target) { NODE_SET_METHOD(target, "getaddrinfo", GetAddrInfo); NODE_SET_METHOD(target, "isIP", IsIP); - target->Set(String::NewSymbol("AF_INET"), Integer::New(AF_INET)); - target->Set(String::NewSymbol("AF_INET6"), Integer::New(AF_INET6)); - target->Set(String::NewSymbol("AF_UNSPEC"), Integer::New(AF_UNSPEC)); + target->Set(String::NewSymbol("AF_INET"), + Integer::New(AF_INET, node_isolate)); + target->Set(String::NewSymbol("AF_INET6"), + Integer::New(AF_INET6, node_isolate)); + target->Set(String::NewSymbol("AF_UNSPEC"), + Integer::New(AF_UNSPEC, node_isolate)); oncomplete_sym = NODE_PSYMBOL("oncomplete"); } diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index dac4dc3ef6..cf4dd0b89a 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -110,7 +110,7 @@ Handle FSEventWrap::Start(const Arguments& args) { SetErrno(uv_last_error(uv_default_loop())); } - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -150,7 +150,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename, } Local argv[3] = { - Integer::New(status), + Integer::New(status, node_isolate), eventStr, filename ? (Local)String::New(filename) : Local::New(v8::Null()) }; diff --git a/src/node.cc b/src/node.cc index deab86eea8..08c5b794ee 100644 --- a/src/node.cc +++ b/src/node.cc @@ -720,7 +720,7 @@ Local ErrnoException(int errorno, Local obj = e->ToObject(); - obj->Set(errno_symbol, Integer::New(errorno)); + obj->Set(errno_symbol, Integer::New(errorno, node_isolate)); obj->Set(code_symbol, estring); if (path) obj->Set(errpath_symbol, String::New(path)); if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall)); @@ -792,7 +792,7 @@ Local UVException(int errorno, Local obj = e->ToObject(); // TODO errno should probably go - obj->Set(errno_symbol, Integer::New(errorno)); + obj->Set(errno_symbol, Integer::New(errorno, node_isolate)); obj->Set(code_symbol, estring); if (path) obj->Set(errpath_symbol, path_str); if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall)); @@ -853,7 +853,7 @@ Local WinapiErrnoException(int errorno, Local obj = e->ToObject(); - obj->Set(errno_symbol, Integer::New(errorno)); + obj->Set(errno_symbol, Integer::New(errorno, node_isolate)); if (path) obj->Set(errpath_symbol, String::New(path)); if (syscall) obj->Set(syscall_symbol, String::NewSymbol(syscall)); return e; @@ -944,7 +944,7 @@ MakeCallback(const Handle object, Local argArray = Array::New(argc); for (int i = 0; i < argc; i++) { - argArray->Set(Integer::New(i), argv[i]); + argArray->Set(Integer::New(i, node_isolate), argv[i]); } Local object_l = Local::New(object); @@ -1501,14 +1501,14 @@ static gid_t gid_by_name(Handle value) { static Handle GetUid(const Arguments& args) { HandleScope scope; int uid = getuid(); - return scope.Close(Integer::New(uid)); + return scope.Close(Integer::New(uid, node_isolate)); } static Handle GetGid(const Arguments& args) { HandleScope scope; int gid = getgid(); - return scope.Close(Integer::New(gid)); + return scope.Close(Integer::New(gid, node_isolate)); } @@ -1577,14 +1577,14 @@ static Handle GetGroups(const Arguments& args) { gid_t egid = getegid(); for (int i = 0; i < ngroups; i++) { - groups_list->Set(i, Integer::New(groups[i])); + groups_list->Set(i, Integer::New(groups[i], node_isolate)); if (groups[i] == egid) seen_egid = true; } delete[] groups; if (seen_egid == false) { - groups_list->Set(ngroups, Integer::New(egid)); + groups_list->Set(ngroups, Integer::New(egid, node_isolate)); } return scope.Close(groups_list); @@ -1721,9 +1721,11 @@ v8::Handle 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())); + Integer::NewFromUnsigned(v8_heap_stats.total_heap_size(), + node_isolate)); 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); } @@ -1742,7 +1744,7 @@ Handle Kill(const Arguments& args) { if (err.code != UV_OK) { SetErrno(err); - return scope.Close(Integer::New(-1)); + return scope.Close(Integer::New(-1, node_isolate)); } return Undefined(); @@ -1775,8 +1777,8 @@ Handle Hrtime(const v8::Arguments& args) { } Local tuple = Array::New(2); - tuple->Set(0, Integer::NewFromUnsigned(t / NANOS_PER_SEC)); - tuple->Set(1, Integer::NewFromUnsigned(t % NANOS_PER_SEC)); + tuple->Set(0, Integer::NewFromUnsigned(t / NANOS_PER_SEC, node_isolate)); + tuple->Set(1, Integer::NewFromUnsigned(t % NANOS_PER_SEC, node_isolate)); return scope.Close(tuple); } @@ -2048,7 +2050,7 @@ static Handle EnvQuery(Local property, #ifdef __POSIX__ String::Utf8Value key(property); if (getenv(*key)) { - return scope.Close(Integer::New(None)); + return scope.Close(Integer::New(0, node_isolate)); } #else // _WIN32 String::Value key(property); @@ -2059,9 +2061,10 @@ static Handle EnvQuery(Local property, // Environment variables that start with '=' are hidden and read-only. return scope.Close(Integer::New(v8::ReadOnly || v8::DontDelete || - v8::DontEnum)); + v8::DontEnum, + node_isolate)); } else { - return scope.Close(Integer::New(None)); + return scope.Close(Integer::New(0, node_isolate)); } } #endif @@ -2163,7 +2166,7 @@ static Handle GetFeatures() { static Handle DebugPortGetter(Local property, const AccessorInfo& info) { HandleScope scope; - return scope.Close(Integer::NewFromUnsigned(debug_port)); + return scope.Close(Integer::NewFromUnsigned(debug_port, node_isolate)); } @@ -2242,10 +2245,10 @@ Handle SetupProcessObject(int argc, char *argv[]) { // process.argv Local arguments = Array::New(argc - option_end_index + 1); - arguments->Set(Integer::New(0), String::New(argv[0])); + arguments->Set(Integer::New(0, node_isolate), String::New(argv[0])); for (j = 1, i = option_end_index; i < argc; j++, i++) { Local arg = String::New(argv[i]); - arguments->Set(Integer::New(j), arg); + arguments->Set(Integer::New(j, node_isolate), arg); } // assign it process->Set(String::NewSymbol("argv"), arguments); @@ -2253,7 +2256,7 @@ Handle SetupProcessObject(int argc, char *argv[]) { // process.execArgv Local execArgv = Array::New(option_end_index - 1); for (j = 1, i = 0; j < option_end_index; j++, i++) { - execArgv->Set(Integer::New(i), String::New(argv[j])); + execArgv->Set(Integer::New(i, node_isolate), String::New(argv[j])); } // assign it process->Set(String::NewSymbol("execArgv"), execArgv); @@ -2270,7 +2273,7 @@ Handle SetupProcessObject(int argc, char *argv[]) { Local env = envTemplate->NewInstance(); process->Set(String::NewSymbol("env"), env); - process->Set(String::NewSymbol("pid"), Integer::New(getpid())); + process->Set(String::NewSymbol("pid"), Integer::New(getpid(), node_isolate)); process->Set(String::NewSymbol("features"), GetFeatures()); // -e, --eval @@ -2912,7 +2915,7 @@ void EmitExit(v8::Handle process_l) { Local emit_v = process_l->Get(String::New("emit")); assert(emit_v->IsFunction()); Local emit = Local::Cast(emit_v); - Local args[] = { String::New("exit"), Integer::New(0) }; + Local args[] = { String::New("exit"), Integer::New(0, node_isolate) }; TryCatch try_catch; emit->Call(process_l, 2, args); if (try_catch.HasCaught()) { diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 14ddb2f6a9..aa600ffeac 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -126,7 +126,7 @@ Handle Buffer::New(Handle string) { Buffer* Buffer::New(size_t length) { HandleScope scope; - Local arg = Integer::NewFromUnsigned(length); + Local arg = Integer::NewFromUnsigned(length, node_isolate); Local b = constructor_template->GetFunction()->NewInstance(1, &arg); if (b.IsEmpty()) return NULL; @@ -137,7 +137,7 @@ Buffer* Buffer::New(size_t length) { Buffer* Buffer::New(const char* data, size_t length) { HandleScope scope; - Local arg = Integer::NewFromUnsigned(0); + Local arg = Integer::NewFromUnsigned(0, node_isolate); Local obj = constructor_template->GetFunction()->NewInstance(1, &arg); Buffer *buffer = ObjectWrap::Unwrap(obj); @@ -151,7 +151,7 @@ Buffer* Buffer::New(char *data, size_t length, free_callback callback, void *hint) { HandleScope scope; - Local arg = Integer::NewFromUnsigned(0); + Local arg = Integer::NewFromUnsigned(0, node_isolate); Local obj = constructor_template->GetFunction()->NewInstance(1, &arg); Buffer *buffer = ObjectWrap::Unwrap(obj); @@ -228,7 +228,7 @@ void Buffer::Replace(char *data, size_t length, handle_->SetIndexedPropertiesToExternalArrayData(data_, kExternalUnsignedByteArray, length_); - handle_->Set(length_symbol, Integer::NewFromUnsigned(length_)); + handle_->Set(length_symbol, Integer::NewFromUnsigned(length_, node_isolate)); } @@ -414,7 +414,7 @@ Handle Buffer::Copy(const Arguments &args) { // Copy 0 bytes; we're done if (source_end == source_start) { - return scope.Close(Integer::New(0)); + return scope.Close(Integer::New(0, node_isolate)); } if (target_start >= target_length) { @@ -441,7 +441,7 @@ Handle Buffer::Copy(const Arguments &args) { (const void*)(source->data_ + source_start), to_copy); - return scope.Close(Integer::New(to_copy)); + return scope.Close(Integer::New(to_copy, node_isolate)); } @@ -463,8 +463,8 @@ Handle Buffer::Utf8Write(const Arguments &args) { if (length == 0) { constructor_template->GetFunction()->Set(chars_written_sym, - Integer::New(0)); - return scope.Close(Integer::New(0)); + Integer::New(0, node_isolate)); + return scope.Close(Integer::New(0, node_isolate)); } if (length > 0 && offset >= buffer->length_) { @@ -487,9 +487,10 @@ Handle Buffer::Utf8Write(const Arguments &args) { String::NO_NULL_TERMINATION)); constructor_template->GetFunction()->Set(chars_written_sym, - Integer::New(char_written)); + Integer::New(char_written, + node_isolate)); - return scope.Close(Integer::New(written)); + return scope.Close(Integer::New(written, node_isolate)); } @@ -525,9 +526,9 @@ Handle Buffer::Ucs2Write(const Arguments &args) { String::NO_NULL_TERMINATION)); constructor_template->GetFunction()->Set(chars_written_sym, - Integer::New(written)); + Integer::New(written, node_isolate)); - return scope.Close(Integer::New(written * 2)); + return scope.Close(Integer::New(written * 2, node_isolate)); } @@ -564,9 +565,9 @@ Handle Buffer::AsciiWrite(const Arguments &args) { String::NO_NULL_TERMINATION)); constructor_template->GetFunction()->Set(chars_written_sym, - Integer::New(written)); + Integer::New(written, node_isolate)); - return scope.Close(Integer::New(written)); + return scope.Close(Integer::New(written, node_isolate)); } @@ -629,9 +630,10 @@ Handle Buffer::Base64Write(const Arguments &args) { } constructor_template->GetFunction()->Set(chars_written_sym, - Integer::New(dst - start)); + Integer::New(dst - start, + node_isolate)); - return scope.Close(Integer::New(dst - start)); + return scope.Close(Integer::New(dst - start, node_isolate)); } @@ -663,9 +665,9 @@ Handle Buffer::BinaryWrite(const Arguments &args) { int written = DecodeWrite(p, max_length, s, BINARY); constructor_template->GetFunction()->Set(chars_written_sym, - Integer::New(written)); + Integer::New(written, node_isolate)); - return scope.Close(Integer::New(written)); + return scope.Close(Integer::New(written, node_isolate)); } @@ -681,7 +683,7 @@ Handle Buffer::ByteLength(const Arguments &args) { Local s = args[0]->ToString(); enum encoding e = ParseEncoding(args[1], UTF8); - return scope.Close(Integer::New(node::ByteLength(s, e))); + return scope.Close(Integer::New(node::ByteLength(s, e), node_isolate)); } diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 2777a1fb07..ec9ecaa6e6 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1308,7 +1308,7 @@ Handle Connection::EncIn(const Arguments& args) { ss->SetShutdownFlags(); } - return scope.Close(Integer::New(bytes_written)); + return scope.Close(Integer::New(bytes_written, node_isolate)); } @@ -1353,14 +1353,14 @@ Handle Connection::ClearOut(const Arguments& args) { ss->HandleSSLError("SSL_connect:ClearOut", rv, kZeroIsAnError); } - if (rv < 0) return scope.Close(Integer::New(rv)); + if (rv < 0) return scope.Close(Integer::New(rv, node_isolate)); } 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)); + return scope.Close(Integer::New(bytes_read, node_isolate)); } @@ -1370,7 +1370,7 @@ Handle 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)); + return scope.Close(Integer::New(bytes_pending, node_isolate)); } @@ -1380,7 +1380,7 @@ Handle 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)); + return scope.Close(Integer::New(bytes_pending, node_isolate)); } @@ -1419,7 +1419,7 @@ Handle Connection::EncOut(const Arguments& args) { ss->HandleBIOError(ss->bio_write_, "BIO_read:EncOut", bytes_read); ss->SetShutdownFlags(); - return scope.Close(Integer::New(bytes_read)); + return scope.Close(Integer::New(bytes_read, node_isolate)); } @@ -1463,7 +1463,7 @@ Handle Connection::ClearIn(const Arguments& args) { ss->HandleSSLError("SSL_connect:ClearIn", rv, kZeroIsAnError); } - if (rv < 0) return scope.Close(Integer::New(rv)); + if (rv < 0) return scope.Close(Integer::New(rv, node_isolate)); } int bytes_written = SSL_write(ss->ssl_, buffer_data + off, len); @@ -1471,7 +1471,7 @@ Handle Connection::ClearIn(const Arguments& args) { ss->HandleSSLError("SSL_write:ClearIn", bytes_written, kZeroIsAnError); ss->SetShutdownFlags(); - return scope.Close(Integer::New(bytes_written)); + return scope.Close(Integer::New(bytes_written, node_isolate)); } @@ -1582,7 +1582,7 @@ Handle 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), String::New(buf)); + ext_key_usage->Set(Integer::New(i, node_isolate), String::New(buf)); } sk_ASN1_OBJECT_pop_free(eku, ASN1_OBJECT_free); @@ -1711,10 +1711,10 @@ Handle Connection::Start(const Arguments& args) { ss->HandleSSLError("SSL_connect:Start", rv, kZeroIsAnError); } - return scope.Close(Integer::New(rv)); + return scope.Close(Integer::New(rv, node_isolate)); } - return scope.Close(Integer::New(0)); + return scope.Close(Integer::New(0, node_isolate)); } @@ -1728,7 +1728,7 @@ Handle Connection::Shutdown(const Arguments& args) { ss->HandleSSLError("SSL_shutdown", rv, kZeroIsNotAnError); ss->SetShutdownFlags(); - return scope.Close(Integer::New(rv)); + return scope.Close(Integer::New(rv, node_isolate)); } diff --git a/src/node_file.cc b/src/node_file.cc index 9e43961266..ba9c539f13 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -144,11 +144,11 @@ static void After(uv_fs_t *req) { break; case UV_FS_OPEN: - argv[1] = Integer::New(req->result); + argv[1] = Integer::New(req->result, node_isolate); break; case UV_FS_WRITE: - argv[1] = Integer::New(req->result); + argv[1] = Integer::New(req->result, node_isolate); 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); + argv[1] = Integer::New(req->result, node_isolate); break; case UV_FS_READDIR: @@ -175,7 +175,7 @@ static void After(uv_fs_t *req) { for (int i = 0; i < nnames; i++) { Local name = String::New(namebuf); - names->Set(Integer::New(i), name); + names->Set(Integer::New(i, node_isolate), name); #ifndef NDEBUG namebuf += strlen(namebuf); assert(*namebuf == '\0'); @@ -314,7 +314,7 @@ Local BuildStatsObject(const uv_statbuf_t* s) { // and make sure that we bail out when V8 returns an empty handle. #define X(name) \ { \ - Local val = Integer::New(s->st_##name); \ + Local val = Integer::New(s->st_##name, node_isolate); \ if (val.IsEmpty()) return Local(); \ stats->Set(name##_symbol, val); \ } @@ -620,7 +620,7 @@ static Handle ReadDir(const Arguments& args) { for (int i = 0; i < nnames; i++) { Local name = String::New(namebuf); - names->Set(Integer::New(i), name); + names->Set(Integer::New(i, node_isolate), name); #ifndef NDEBUG namebuf += strlen(namebuf); assert(*namebuf == '\0'); @@ -654,7 +654,7 @@ static Handle Open(const Arguments& args) { } else { SYNC_CALL(open, *path, *path, flags, mode) int fd = SYNC_RESULT; - return scope.Close(Integer::New(fd)); + return scope.Close(Integer::New(fd, node_isolate)); } } @@ -707,7 +707,7 @@ static Handle 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)); + return scope.Close(Integer::New(SYNC_RESULT, node_isolate)); } } @@ -770,7 +770,7 @@ static Handle Read(const Arguments& args) { ASYNC_CALL(read, cb, fd, buf, len, pos); } else { SYNC_CALL(read, 0, fd, buf, len, pos) - Local bytesRead = Integer::New(SYNC_RESULT); + Local bytesRead = Integer::New(SYNC_RESULT, node_isolate); return scope.Close(bytesRead); } } diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index adddb04906..448136aa31 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -269,12 +269,15 @@ public: // STATUS if (parser_.type == HTTP_RESPONSE) { - message_info->Set(status_code_sym, Integer::New(parser_.status_code)); + message_info->Set(status_code_sym, + Integer::New(parser_.status_code, node_isolate)); } // VERSION - message_info->Set(version_major_sym, Integer::New(parser_.http_major)); - message_info->Set(version_minor_sym, Integer::New(parser_.http_minor)); + message_info->Set(version_major_sym, + Integer::New(parser_.http_major, node_isolate)); + message_info->Set(version_minor_sym, + Integer::New(parser_.http_minor, node_isolate)); message_info->Set(should_keep_alive_sym, http_should_keep_alive(&parser_) ? True() : False()); @@ -304,8 +307,8 @@ public: Local argv[3] = { *current_buffer, - Integer::New(at - current_buffer_data), - Integer::New(length) + Integer::New(at - current_buffer_data, node_isolate), + Integer::New(length, node_isolate) }; Local r = Local::Cast(cb)->Call(handle_, 3, argv); @@ -428,7 +431,7 @@ public: // If there was an exception in one of the callbacks if (parser->got_exception_) return Local(); - Local nparsed_obj = Integer::New(nparsed); + Local nparsed_obj = Integer::New(nparsed, node_isolate); // 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) { @@ -462,7 +465,7 @@ public: Local e = Exception::Error(String::NewSymbol("Parse Error")); Local obj = e->ToObject(); - obj->Set(String::NewSymbol("bytesParsed"), Integer::New(0)); + obj->Set(String::NewSymbol("bytesParsed"), Integer::New(0, node_isolate)); obj->Set(String::NewSymbol("code"), String::New(http_errno_name(err))); return scope.Close(e); } @@ -558,8 +561,12 @@ void InitHttpParser(Handle target) { t->SetClassName(String::NewSymbol("HTTPParser")); PropertyAttribute attrib = (PropertyAttribute) (ReadOnly | DontDelete); - t->Set(String::NewSymbol("REQUEST"), Integer::New(HTTP_REQUEST), attrib); - t->Set(String::NewSymbol("RESPONSE"), Integer::New(HTTP_RESPONSE), attrib); + t->Set(String::NewSymbol("REQUEST"), + Integer::New(HTTP_REQUEST, node_isolate), + attrib); + t->Set(String::NewSymbol("RESPONSE"), + Integer::New(HTTP_RESPONSE, node_isolate), + attrib); NODE_SET_PROTOTYPE_METHOD(t, "execute", Parser::Execute); NODE_SET_PROTOTYPE_METHOD(t, "finish", Parser::Finish); diff --git a/src/node_os.cc b/src/node_os.cc index d6ac915723..145ba47244 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -124,19 +124,20 @@ static Handle GetCPUInfo(const Arguments& args) { for (i = 0; i < count; i++) { Local times_info = Object::New(); times_info->Set(String::New("user"), - Integer::New(cpu_infos[i].cpu_times.user)); + Integer::New(cpu_infos[i].cpu_times.user, node_isolate)); times_info->Set(String::New("nice"), - Integer::New(cpu_infos[i].cpu_times.nice)); + Integer::New(cpu_infos[i].cpu_times.nice, node_isolate)); times_info->Set(String::New("sys"), - Integer::New(cpu_infos[i].cpu_times.sys)); + Integer::New(cpu_infos[i].cpu_times.sys, node_isolate)); times_info->Set(String::New("idle"), - Integer::New(cpu_infos[i].cpu_times.idle)); + Integer::New(cpu_infos[i].cpu_times.idle, node_isolate)); times_info->Set(String::New("irq"), - Integer::New(cpu_infos[i].cpu_times.irq)); + Integer::New(cpu_infos[i].cpu_times.irq, node_isolate)); Local 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)); + cpu_info->Set(String::New("speed"), + Integer::New(cpu_infos[i].speed, node_isolate)); cpu_info->Set(String::New("times"), times_info); (*cpus)->Set(i,cpu_info); } diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index c3f668c086..7e77c977cb 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -79,7 +79,7 @@ void StatWatcher::Callback(uv_fs_poll_t* handle, Local argv[3]; argv[0] = BuildStatsObject(curr); argv[1] = BuildStatsObject(prev); - argv[2] = Integer::New(status); + argv[2] = Integer::New(status, node_isolate); if (status == -1) { SetErrno(uv_last_error(wrap->watcher_->loop)); } diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 881b20ce62..373bf188af 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -244,8 +244,8 @@ class ZCtx : public ObjectWrap { return; } - Local avail_out = Integer::New(ctx->strm_.avail_out); - Local avail_in = Integer::New(ctx->strm_.avail_in); + Local avail_out = Integer::New(ctx->strm_.avail_out, node_isolate); + Local avail_in = Integer::New(ctx->strm_.avail_in, node_isolate); ctx->write_in_progress_ = false; diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index eb00e18aa1..abe9fefea5 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -146,7 +146,7 @@ Handle PipeWrap::Bind(const Arguments& args) { // Error starting the pipe. if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -177,7 +177,7 @@ Handle PipeWrap::Listen(const Arguments& args) { // Error starting the pipe. if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -238,7 +238,7 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) { } Local argv[5] = { - Integer::New(status), + Integer::New(status, node_isolate), Local::New(wrap->object_), Local::New(req_wrap->object_), Local::New(Boolean::New(readable)), diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 60f422d354..b9f26dd6cf 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -250,7 +250,8 @@ class ProcessWrap : public HandleWrap { else { wrap->SetHandle((uv_handle_t*)&wrap->process_); assert(wrap->process_.data == wrap); - wrap->object_->Set(String::New("pid"), Integer::New(wrap->process_.pid)); + wrap->object_->Set(String::New("pid"), + Integer::New(wrap->process_.pid, node_isolate)); } if (options.args) { @@ -265,7 +266,7 @@ class ProcessWrap : public HandleWrap { delete[] options.stdio; - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } static Handle Kill(const Arguments& args) { @@ -279,7 +280,7 @@ class ProcessWrap : public HandleWrap { if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } static void OnExit(uv_process_t* handle, int exit_status, int term_signal) { @@ -290,7 +291,7 @@ class ProcessWrap : public HandleWrap { assert(&wrap->process_ == handle); Local argv[2] = { - Integer::New(exit_status), + Integer::New(exit_status, node_isolate), String::New(signo_string(term_signal)) }; diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index 6d93cf0960..984c057ab0 100644 --- a/src/signal_wrap.cc +++ b/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)); + return scope.Close(Integer::New(r, node_isolate)); } static Handle 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)); + return scope.Close(Integer::New(r, node_isolate)); } 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 argv[1] = { Integer::New(signum) }; + Local argv[1] = { Integer::New(signum, node_isolate) }; MakeCallback(wrap->object_, onsignal_sym, ARRAY_SIZE(argv), argv); } diff --git a/src/slab_allocator.cc b/src/slab_allocator.cc index e0d7b13132..0eb8ba8323 100644 --- a/src/slab_allocator.cc +++ b/src/slab_allocator.cc @@ -71,7 +71,7 @@ void SlabAllocator::Initialize() { static Local NewSlab(unsigned int size) { HandleScope scope; - Local arg = Integer::NewFromUnsigned(ROUND_UP(size, 16)); + Local arg = Integer::NewFromUnsigned(ROUND_UP(size, 16), node_isolate); Local buf = Buffer::constructor_template ->GetFunction() ->NewInstance(1, &arg); diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 8229db22a2..7b87a596f4 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -124,7 +124,8 @@ void StreamWrap::SetHandle(uv_handle_t* h) { void StreamWrap::UpdateWriteQueueSize() { HandleScope scope; - object_->Set(write_queue_size_sym, Integer::New(stream_->write_queue_size)); + object_->Set(write_queue_size_sym, + Integer::New(stream_->write_queue_size, node_isolate)); } @@ -145,7 +146,7 @@ Handle StreamWrap::ReadStart(const Arguments& args) { // Error starting the tcp. if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -159,7 +160,7 @@ Handle StreamWrap::ReadStop(const Arguments& args) { // Error starting the tcp. if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -204,8 +205,8 @@ void StreamWrap::OnReadCommon(uv_stream_t* handle, ssize_t nread, int argc = 3; Local argv[4] = { slab, - Integer::NewFromUnsigned(buf.base - Buffer::Data(slab)), - Integer::NewFromUnsigned(nread) + Integer::NewFromUnsigned(buf.base - Buffer::Data(slab), node_isolate), + Integer::NewFromUnsigned(nread, node_isolate) }; Local pending_obj; @@ -474,7 +475,7 @@ void StreamWrap::AfterWrite(uv_write_t* req, int status) { wrap->UpdateWriteQueueSize(); Local argv[] = { - Integer::New(status), + Integer::New(status, node_isolate), Local::New(wrap->object_), Local::New(req_wrap->object_) }; @@ -522,7 +523,7 @@ void StreamWrap::AfterShutdown(uv_shutdown_t* req, int status) { } Local argv[3] = { - Integer::New(status), + Integer::New(status, node_isolate), Local::New(wrap->object_), Local::New(req_wrap->object_) }; diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index dc282926d7..4891162ece 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -260,7 +260,7 @@ Handle TCPWrap::Bind(const Arguments& args) { // Error starting the tcp. if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -278,7 +278,7 @@ Handle TCPWrap::Bind6(const Arguments& args) { // Error starting the tcp. if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -294,7 +294,7 @@ Handle TCPWrap::Listen(const Arguments& args) { // Error starting the tcp. if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -347,7 +347,7 @@ void TCPWrap::AfterConnect(uv_connect_t* req, int status) { } Local argv[5] = { - Integer::New(status), + Integer::New(status, node_isolate), Local::New(wrap->object_), Local::New(req_wrap->object_), Local::New(v8::True()), @@ -448,7 +448,7 @@ Local 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)); + info->Set(port_sym, Integer::New(port, node_isolate)); break; case AF_INET: @@ -457,7 +457,7 @@ Local 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)); + info->Set(port_sym, Integer::New(port, node_isolate)); break; default: diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index 92964af7a3..5a0c462dea 100644 --- a/src/timer_wrap.cc +++ b/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)); + return scope.Close(Integer::New(r, node_isolate)); } static Handle 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)); + return scope.Close(Integer::New(r, node_isolate)); } static Handle 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)); + return scope.Close(Integer::New(r, node_isolate)); } static Handle 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)); + return scope.Close(Integer::New(0, node_isolate)); } static Handle 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)); + return scope.Close(Integer::New(repeat, node_isolate)); } static void OnTimeout(uv_timer_t* handle, int status) { @@ -159,7 +159,7 @@ class TimerWrap : public HandleWrap { TimerWrap* wrap = static_cast(handle->data); assert(wrap); - Local argv[1] = { Integer::New(status) }; + Local argv[1] = { Integer::New(status, node_isolate) }; MakeCallback(wrap->object_, ontimeout_sym, ARRAY_SIZE(argv), argv); } diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index 605d531999..7875c7dfe0 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -136,8 +136,8 @@ Handle TTYWrap::GetWindowSize(const Arguments& args) { } Local a = v8::Array::New(2); - a->Set(0, Integer::New(width)); - a->Set(1, Integer::New(height)); + a->Set(0, Integer::New(width, node_isolate)); + a->Set(1, Integer::New(height, node_isolate)); return scope.Close(a); } @@ -154,7 +154,7 @@ Handle TTYWrap::SetRawMode(const Arguments& args) { SetErrno(uv_last_error(uv_default_loop())); } - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index caf1fdc7f0..23b0074c45 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -140,7 +140,7 @@ Handle UDPWrap::DoBind(const Arguments& args, int family) { if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -157,12 +157,12 @@ Handle UDPWrap::Bind6(const Arguments& args) { #define X(name, fn) \ Handle UDPWrap::name(const Arguments& args) { \ HandleScope scope; \ - UNWRAP(UDPWrap) \ + UNWRAP(UDPWrap) \ assert(args.Length() == 1); \ 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)); \ + return scope.Close(Integer::New(r, node_isolate)); \ } X(SetTTL, uv_udp_set_ttl) @@ -194,7 +194,7 @@ Handle UDPWrap::SetMembership(const Arguments& args, if (r) SetErrno(uv_last_error(uv_default_loop())); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -294,7 +294,7 @@ Handle UDPWrap::RecvStop(const Arguments& args) { int r = uv_udp_recv_stop(&wrap->handle_); - return scope.Close(Integer::New(r)); + return scope.Close(Integer::New(r, node_isolate)); } @@ -336,7 +336,7 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) { } Local argv[4] = { - Integer::New(status), + Integer::New(status, node_isolate), Local::New(wrap->object_), Local::New(req_wrap->object_), req_wrap->object_->GetHiddenValue(buffer_sym), @@ -377,8 +377,8 @@ void UDPWrap::OnRecv(uv_udp_t* handle, Local argv[] = { Local::New(wrap->object_), slab, - Integer::NewFromUnsigned(buf.base - Buffer::Data(slab)), - Integer::NewFromUnsigned(nread), + Integer::NewFromUnsigned(buf.base - Buffer::Data(slab), node_isolate), + Integer::NewFromUnsigned(nread, node_isolate), AddressToJS(addr) }; MakeCallback(wrap->object_, onmessage_sym, ARRAY_SIZE(argv), argv); diff --git a/src/v8_typed_array.cc b/src/v8_typed_array.cc index 2650537e6f..9c370d6908 100644 --- a/src/v8_typed_array.cc +++ b/src/v8_typed_array.cc @@ -32,6 +32,7 @@ namespace { using node::ThrowRangeError; using node::ThrowTypeError; using node::ThrowError; +using node::node_isolate; struct BatchedMethods { const char* name; @@ -109,7 +110,7 @@ class ArrayBuffer { args.This()->SetAlignedPointerInInternalField(0, buf); args.This()->Set(v8::String::New("byteLength"), - v8::Integer::NewFromUnsigned(num_bytes), + v8::Integer::NewFromUnsigned(num_bytes, node_isolate), (v8::PropertyAttribute)(v8::ReadOnly|v8::DontDelete)); // NOTE(deanm): This is not in the spec, you shouldn't be able to index @@ -151,7 +152,7 @@ class ArrayBuffer { unsigned int slice_length = end - begin; v8::Local argv[] = { - v8::Integer::New(slice_length)}; + v8::Integer::New(slice_length, node_isolate)}; v8::Local buffer = ArrayBuffer::GetTemplate()-> GetFunction()->NewInstance(1, argv); @@ -269,7 +270,7 @@ class TypedArray { // TODO(deanm): Handle integer overflow. v8::Local argv[1] = { - v8::Integer::NewFromUnsigned(length * TBytes)}; + v8::Integer::NewFromUnsigned(length * TBytes, node_isolate)}; buffer = ArrayBuffer::GetTemplate()-> GetFunction()->NewInstance(1, argv); if (buffer.IsEmpty()) return v8::Undefined(); // constructor failed @@ -297,7 +298,7 @@ class TypedArray { length = args[0]->Uint32Value(); // TODO(deanm): Handle integer overflow. v8::Local argv[1] = { - v8::Integer::NewFromUnsigned(length * TBytes)}; + v8::Integer::NewFromUnsigned(length * TBytes, node_isolate)}; buffer = ArrayBuffer::GetTemplate()-> GetFunction()->NewInstance(1, argv); @@ -313,13 +314,14 @@ class TypedArray { buffer, (v8::PropertyAttribute)(v8::ReadOnly|v8::DontDelete)); args.This()->Set(v8::String::New("length"), - v8::Integer::NewFromUnsigned(length), + v8::Integer::NewFromUnsigned(length, node_isolate), (v8::PropertyAttribute)(v8::ReadOnly|v8::DontDelete)); args.This()->Set(v8::String::New("byteOffset"), - v8::Integer::NewFromUnsigned(byte_offset), + v8::Integer::NewFromUnsigned(byte_offset, node_isolate), (v8::PropertyAttribute)(v8::ReadOnly|v8::DontDelete)); args.This()->Set(v8::String::New("byteLength"), - v8::Integer::NewFromUnsigned(length * TBytes), + v8::Integer::NewFromUnsigned(length * TBytes, + node_isolate), (v8::PropertyAttribute)(v8::ReadOnly|v8::DontDelete)); return args.This(); @@ -428,8 +430,8 @@ class TypedArray { // Call through to the ArrayBuffer, byteOffset, length constructor. v8::Local argv[] = { args.This()->Get(v8::String::New("buffer")), - v8::Integer::New(byte_offset), - v8::Integer::New(end - begin)}; + v8::Integer::New(byte_offset, node_isolate), + v8::Integer::New(end - begin, node_isolate)}; return TypedArray::GetTemplate()-> GetFunction()->NewInstance(3, argv); } @@ -469,32 +471,32 @@ v8::Handle cTypeToValue(T) { template <> v8::Handle cTypeToValue(unsigned char val) { - return v8::Integer::NewFromUnsigned(val); + return v8::Integer::NewFromUnsigned(val, node_isolate); } template <> v8::Handle cTypeToValue(signed char val) { - return v8::Integer::New(val); + return v8::Integer::New(val, node_isolate); } template <> v8::Handle cTypeToValue(unsigned short val) { - return v8::Integer::NewFromUnsigned(val); + return v8::Integer::NewFromUnsigned(val, node_isolate); } template <> v8::Handle cTypeToValue(short val) { - return v8::Integer::New(val); + return v8::Integer::New(val, node_isolate); } template <> v8::Handle cTypeToValue(unsigned int val) { - return v8::Integer::NewFromUnsigned(val); + return v8::Integer::NewFromUnsigned(val, node_isolate); } template <> v8::Handle cTypeToValue(int val) { - return v8::Integer::New(val); + return v8::Integer::New(val, node_isolate); } template <> @@ -650,10 +652,10 @@ class DataView { buffer, (v8::PropertyAttribute)(v8::ReadOnly|v8::DontDelete)); args.This()->Set(v8::String::New("byteOffset"), - v8::Integer::NewFromUnsigned(byte_offset), + v8::Integer::NewFromUnsigned(byte_offset, node_isolate), (v8::PropertyAttribute)(v8::ReadOnly|v8::DontDelete)); args.This()->Set(v8::String::New("byteLength"), - v8::Integer::NewFromUnsigned(byte_length), + v8::Integer::NewFromUnsigned(byte_length, node_isolate), (v8::PropertyAttribute)(v8::ReadOnly|v8::DontDelete)); return args.This(); }