lib, src: upgrade after v8 api change
authorBen Noordhuis <info@bnoordhuis.nl>
Wed, 3 Jul 2013 02:23:44 +0000 (04:23 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Sat, 6 Jul 2013 15:44:44 +0000 (17:44 +0200)
commit110a9cd8db515c4d1a9ac5cd8837291da7c6c5ea
tree71e5a14a98131d89d670f842eb36bfcccab00b7b
parent9b3de60d3537df657e75887436a5b1df5ed80c2d
lib, src: upgrade after v8 api change

This is a big commit that touches just about every file in the src/
directory. The V8 API has changed in significant ways. The most
important changes are:

* Binding functions take a const v8::FunctionCallbackInfo<T>& argument
  rather than a const v8::Arguments& argument.

* Binding functions return void rather than v8::Handle<v8::Value>. The
  return value is returned with the args.GetReturnValue().Set() family
  of functions.

* v8::Persistent<T> no longer derives from v8::Handle<T> and no longer
  allows you to directly dereference the object that the persistent
  handle points to. This means that the common pattern of caching
  oft-used JS values in a persistent handle no longer quite works,
  you first need to reconstruct a v8::Local<T> from the persistent
  handle with the Local<T>::New(isolate, persistent) factory method.

A handful of (internal) convenience classes and functions have been
added to make dealing with the new API a little easier.

The most visible one is node::Cached<T>, which wraps a v8::Persistent<T>
with some template sugar. It can hold arbitrary types but so far it's
exclusively used for v8::Strings (which was by far the most commonly
cached handle type.)
43 files changed:
lib/net.js
node.gyp
src/cares_wrap.cc
src/fs_event_wrap.cc
src/handle_wrap.cc
src/handle_wrap.h
src/node.cc
src/node.h
src/node_buffer.cc
src/node_counters.cc
src/node_crypto.cc
src/node_crypto.h
src/node_dtrace.cc
src/node_file.cc
src/node_http_parser.cc
src/node_internals.h
src/node_object_wrap.h
src/node_os.cc
src/node_script.cc
src/node_stat_watcher.cc
src/node_stat_watcher.h
src/node_wrap.h
src/node_zlib.cc
src/pipe_wrap.cc
src/pipe_wrap.h
src/process_wrap.cc
src/req_wrap.h
src/signal_wrap.cc
src/smalloc.cc
src/stream_wrap.cc
src/stream_wrap.h
src/tcp_wrap.cc
src/tcp_wrap.h
src/timer_wrap.cc
src/tls_wrap.cc
src/tls_wrap.h
src/tty_wrap.cc
src/tty_wrap.h
src/udp_wrap.cc
src/udp_wrap.h
src/v8_typed_array.cc [deleted file]
src/v8_typed_array.h [deleted file]
src/v8_typed_array_bswap.h [deleted file]