Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
src: add multi-context support
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.
  • Loading branch information
bnoordhuis committed Sep 6, 2013
1 parent 81655a2 commit 756b6222956b5d25b2e7db81f4e79033a3a4d20e
@@ -116,6 +116,8 @@
# headers to make for a more pleasant IDE experience
@@ -124,6 +126,7 @@
@@ -139,6 +142,8 @@
# javascript files to make for an even more pleasant IDE experience

0 comments on commit 756b622

Please sign in to comment.