v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Script Class Reference

#include <v8.h>

Public Member Functions

Local< ValueRun ()
 
Local< UnboundScriptGetUnboundScript ()
 
int GetId ()
 
 V8_DEPRECATED ("Use GetUnboundScript()->GetId()", Handle< Value > GetScriptName())
 
 V8_DEPRECATED ("Use GetUnboundScript()->GetLineNumber()", int GetLineNumber(int code_pos))
 

Static Public Member Functions

static Local< ScriptCompile (Handle< String > source, ScriptOrigin *origin=NULL, ScriptData *script_data=NULL)
 
static Local< ScriptCompile (Handle< String > source, Handle< String > file_name)
 

Detailed Description

A compiled JavaScript script, tied to a Context which was active when the script was compiled.

Definition at line 1039 of file v8.h.

Member Function Documentation

Local< Script > Compile ( v8::Handle< String source,
v8::Handle< String file_name 
)
static

Definition at line 1855 of file api.cc.

References ScriptCompiler::Compile().

int GetId ( )
inline

Definition at line 1067 of file v8.h.

Referenced by TEST(), and THREADED_TEST().

Local< UnboundScript > GetUnboundScript ( )

Returns the corresponding context-unbound script.

Definition at line 1716 of file api.cc.

References JSFunction::cast(), and Utils::OpenHandle().

Local< Value > Run ( )

Runs the script returning the resulting value. It will be run in the context in which it was created (ScriptCompiler::CompileBound or UnboundScript::BindToGlobalContext()).

Definition at line 1686 of file api.cc.

References Execution::Call(), Handle< T >::cast(), JSFunction::cast(), Isolate::context(), ENTER_V8, EXCEPTION_BAILOUT_CHECK_DO_CALLBACK, EXCEPTION_PREAMBLE, Context::global_proxy(), LOG_API, NULL, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

Referenced by DeclarationContext::Check(), SimpleContext::Check(), DEPENDENT_TEST(), ExecuteString(), main(), ThreadA::Run(), RunMain(), TEST(), and THREADED_TEST().

V8_DEPRECATED ( "Use GetUnboundScript()->GetId()"  ,
Handle< Value >   GetScriptName() 
)
inline

Definition at line 1072 of file v8.h.

V8_DEPRECATED ( "Use GetUnboundScript()->GetLineNumber()"  ,
int   GetLineNumberint code_pos 
)
inline

Returns zero based line number of the code_pos location in the script. -1 will be returned if no information available.

Definition at line 1081 of file v8.h.


The documentation for this class was generated from the following files: