V8 provides a nice developer shell to interactively execute and debug
javascript code using their Engine.
The build instructions as well as the dependencies can be found here.
To allow calling native C++ functions from javascript directly such as
what is done in the standard libraries (see src/v8natives.js), simply
set the "allow_natives_syntax" flag from src/flag-definitions.h to
"true". This will allow calling functions like %CompileString directly.
To see how C++ functions can be exposed to javascript, look at void
Shell::Initialize() from src/d8.cc.
When an error occurs, the d8 shell automatically enters debug mode. The
listing of available commands can be found at "function DebugRequest"
of src/d8.js.
Erick