v8
3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Public Member Functions | |
Local< Value > | Run () |
Local< Value > | Id () |
void | SetData (Handle< String > data) |
Static Public Member Functions | |
static Local< Script > | New (Handle< String > source, ScriptOrigin *origin=NULL, ScriptData *pre_data=NULL, Handle< String > script_data=Handle< String >()) |
static Local< Script > | New (Handle< String > source, Handle< Value > file_name) |
static Local< Script > | Compile (Handle< String > source, ScriptOrigin *origin=NULL, ScriptData *pre_data=NULL, Handle< String > script_data=Handle< String >()) |
static Local< Script > | Compile (Handle< String > source, Handle< Value > file_name, Handle< String > script_data=Handle< String >()) |
|
static |
Compiles the specified script (bound to current context).
source | Script source code. |
origin | Script origin, owned by caller, no references are kept when Compile() returns |
pre_data | Pre-parsing data, as obtained by ScriptData::PreCompile() using pre_data speeds compilation if it's done multiple times. Owned by caller, no references are kept when Compile() returns. |
script_data | Arbitrary data associated with script. Using this has same effect as calling SetData(), but makes data available earlier (i.e. to compile event handlers). |
Definition at line 1568 of file api.cc.
References SharedFunctionInfo::cast(), ENTER_V8, Isolate::factory(), Isolate::global_context(), LOG_API, Script::New(), Factory::NewFunctionFromSharedFunctionInfo(), and ON_BAILOUT.
Referenced by CCatcher(), Script::Compile(), DEPENDENT_TEST(), DoLoop(), DoLoopNoCall(), ExecuteString(), Shell::ExecuteString(), Loop(), LoopGetProperty(), main(), ReenterAfterTermination(), ThreadA::Run(), LoopingThread::Run(), RunMain(), TEST(), and THREADED_TEST().
|
static |
Compiles the specified script using the specified file name object (typically a string) as the script's origin.
source | Script source code. |
file_name | File name to use as script's origin |
script_data | Arbitrary data associated with script. Using this has same effect as calling SetData(), but makes data available earlier (i.e. to compile event handlers). |
Definition at line 1590 of file api.cc.
References Script::Compile().
Returns the script id value.
Definition at line 1643 of file api.cc.
References Script::cast(), LOG_API, NULL, ON_BAILOUT, and Utils::ToLocal().
Referenced by THREADED_TEST().
|
static |
Compiles the specified script (context-independent).
source | Script source code. |
origin | Script origin, owned by caller, no references are kept when New() returns |
pre_data | Pre-parsing data, as obtained by ScriptData::PreCompile() using pre_data speeds compilation if it's done multiple times. Owned by caller, no references are kept when New() returns. |
script_data | Arbitrary data associated with script. Using this has same effect as calling SetData(), but allows data to be available to compile event handlers. |
Definition at line 1506 of file api.cc.
References ASSERT, Compiler::Compile(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Isolate::global_context(), Handle< T >::is_null(), Handle< T >::IsEmpty(), LOG_API, v8::internal::NOT_NATIVES_CODE, NULL, ON_BAILOUT, ScriptOrigin::ResourceColumnOffset(), ScriptOrigin::ResourceLineOffset(), ScriptOrigin::ResourceName(), and ScriptDataImpl::SanityCheck().
Referenced by Script::Compile(), Script::New(), TEST(), and THREADED_TEST().
|
static |
Compiles the specified script using the specified file name object (typically a string) as the script's origin.
source | Script source code. |
file_name | file name object (typically a string) to be used as the script's origin. |
Definition at line 1561 of file api.cc.
References Script::New().
Runs the script returning the resulting value. If the script is context independent (created using ::New) it will be run in the currently entered context. If it is context specific (created using ::Compile) it will be run in the context in which it was compiled.
Definition at line 1598 of file api.cc.
References Execution::Call(), SharedFunctionInfo::cast(), JSFunction::cast(), Isolate::context(), ENTER_V8, EXCEPTION_BAILOUT_CHECK_DO_CALLBACK, EXCEPTION_PREAMBLE, Isolate::factory(), Isolate::global_context(), Context::global_proxy(), LOG_API, Factory::NewFunctionFromSharedFunctionInfo(), NULL, ON_BAILOUT, and Utils::ToLocal().
Referenced by DeclarationContext::Check(), SimpleContext::Check(), DEPENDENT_TEST(), ExecuteString(), Shell::ExecuteString(), main(), ThreadA::Run(), RunMain(), TEST(), THREADED_TEST(), and WhammyPropertyGetter().
void SetData | ( | v8::Handle< String > | data | ) |
Associate an additional data object with the script. This is mainly used with the debugger as this data object is only available through the debugger API.
Definition at line 1660 of file api.cc.
References Script::cast(), LOG_API, and ON_BAILOUT.
Referenced by THREADED_TEST().