Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on May 30, 2014
  1. @bnoordhuis @indutny

    src: replace CONTAINER_OF with type-safe function

    bnoordhuis committed with indutny
    Replace the CONTAINER_OF macro with a template function that is as
    type-safe as a reinterpret_cast<> of an arbitrary pointer can be made.
    Signed-off-by: Fedor Indutny <>
Commits on Nov 12, 2013
  1. @bnoordhuis

    src: fix Context::Scope usage

    bnoordhuis committed
    env->context() may or may not create a new Local.  It currently does
    not but don't depend on that behavior, create a HandleScope first.
Commits on Nov 11, 2013
  1. @bnoordhuis

    src: fix Environment::GetCurrent() usage

    bnoordhuis committed
    Create a HandleScope before calling the Environment::GetCurrent() that
    takes a v8::Isolate* as an argument because it creates a handle with
    the call to v8::Isolate::CurrentContext().
Commits on Nov 8, 2013
  1. @bnoordhuis

    src: remove container_of, use CONTAINER_OF

    bnoordhuis committed
    CONTAINER_OF was introduced a while ago but was not used consistently
    everywhere yet.  This commit fixes that.
    Why CONTAINER_OF instead of container_of?  The former makes it crystal
    clear that it's a macro, not a function.
Commits on Sep 6, 2013
  1. @bnoordhuis

    src: add multi-context support

    bnoordhuis committed
    This commit makes it possible to use multiple V8 execution contexts
    within a single event loop.  Put another way, handle and request wrap
    objects now "remember" the context they belong to and switch back to
    that context when the time comes to call into JS land.
    This could have been done in a quick and hacky way by calling
    v8::Object::GetCreationContext() on the wrap object right before
    making a callback but that leaves a fairly wide margin for bugs.
    Instead, we make the context explicit through a new Environment class
    that encapsulates everything (or almost everything) that belongs to
    the context.  Variables that used to be a static or a global are now
    members of the aforementioned class.  An additional benefit is that
    this approach should make it relatively straightforward to add full
    isolate support in due course.
    There is no JavaScript API yet but that will be added in the near
    This work was graciously sponsored by GitHub, Inc.
Commits on Aug 9, 2013
  1. @bnoordhuis

    src: use v8::String::NewFrom*() functions

    bnoordhuis committed
    * Change calls to String::New() and String::NewSymbol() to their
      respective one-byte, two-byte and UTF-8 counterparts.
    * Add a FIXED_ONE_BYTE_STRING macro that takes a string literal and
      turns it into a v8::Local<v8::String>.
    * Add helper functions that make v8::String::NewFromOneByte() easier to
      work with. Said function expects a `const uint8_t*` but almost every
      call site deals with `const char*` or `const unsigned char*`. Helps
      us avoid doing reinterpret_casts all over the place.
    * Code that handles file system paths keeps using UTF-8 for backwards
      compatibility reasons. At least now the use of UTF-8 is explicit.
    * Remove v8::String::NewSymbol() entirely. Almost all call sites were
      effectively minor de-optimizations. If you create a string only once,
      there is no point in making it a symbol. If you are create the same
      string repeatedly, it should probably be cached in a persistent
Commits on Aug 7, 2013
  1. @bnoordhuis

    src: remove no-op HandleWrap::Initialize()

    bnoordhuis committed
    It's never been used and we probably never will. Remove it.
Commits on Jul 20, 2013
  1. @bnoordhuis

    src, lib: update after internal api change

    bnoordhuis committed
    Libuv now returns errors directly.  Make everything in src/ and lib/
    follow suit.
    The changes to lib/ are not strictly necessary but they remove the need
    for the abominations that are process._errno and node::SetErrno().
Commits on Jul 6, 2013
  1. @bnoordhuis

    lib, src: upgrade after v8 api change

    bnoordhuis committed
    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.)
Commits on Jun 17, 2013
  1. @bnoordhuis

    src: clean up `using` directives

    bnoordhuis committed
    Remove the unused ones and alphabetically sort the ones that remain.
Commits on Feb 25, 2013
  1. @bnoordhuis
Commits on Jan 7, 2013
  1. @bnoordhuis
Commits on Aug 21, 2012
  1. @bnoordhuis
Something went wrong with that request. Please try again.