v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::Script Class Reference

#include <v8-script.h>

Inheritance diagram for v8::Script:
Collaboration diagram for v8::Script:

Public Member Functions

V8_WARN_UNUSED_RESULT MaybeLocal< ValueRun (Local< Context > context)
 
V8_WARN_UNUSED_RESULT MaybeLocal< ValueRun (Local< Context > context, Local< Data > host_defined_options)
 
Local< UnboundScriptGetUnboundScript ()
 
Local< ValueGetResourceName ()
 
std::vector< int > GetProducedCompileHints () const
 
Local< CompileHintsCollectorGetCompileHintsCollector () const
 
- Public Member Functions inherited from v8::Data
bool IsValue () const
 
bool IsModule () const
 
bool IsModuleRequest () const
 
bool IsFixedArray () const
 
bool IsPrivate () const
 
bool IsObjectTemplate () const
 
bool IsFunctionTemplate () const
 
bool IsContext () const
 

Static Public Member Functions

static V8_WARN_UNUSED_RESULT MaybeLocal< ScriptCompile (Local< Context > context, Local< String > source, ScriptOrigin *origin=nullptr)
 

Detailed Description

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

Definition at line 353 of file v8-script.h.

Member Function Documentation

◆ Compile()

MaybeLocal< Script > v8::Script::Compile ( Local< Context > context,
Local< String > source,
ScriptOrigin * origin = nullptr )
static

A shorthand for ScriptCompiler::Compile().

Definition at line 2718 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCompileHintsCollector()

Local< CompileHintsCollector > v8::Script::GetCompileHintsCollector ( ) const

Get a compile hints collector object which we can use later for retrieving compile hints (= positions of lazy functions which were compiled and executed).

Definition at line 2002 of file api.cc.

Here is the call graph for this function:

◆ GetProducedCompileHints()

std::vector< int > v8::Script::GetProducedCompileHints ( ) const

If the script was compiled, returns the positions of lazy functions which were eventually compiled and executed.

Definition at line 1979 of file api.cc.

Here is the call graph for this function:

◆ GetResourceName()

Local< Value > v8::Script::GetResourceName ( )

The name that was passed by the embedder as ResourceName to the ScriptOrigin. This can be either a v8::String or v8::Undefined.

Definition at line 1969 of file api.cc.

Here is the call graph for this function:

◆ GetUnboundScript()

Local< UnboundScript > v8::Script::GetUnboundScript ( )

Returns the corresponding context-unbound script.

Definition at line 1961 of file api.cc.

Here is the call graph for this function:

◆ Run() [1/2]

MaybeLocal< Value > v8::Script::Run ( Local< Context > context)

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

Definition at line 1902 of file api.cc.

◆ Run() [2/2]

MaybeLocal< Value > v8::Script::Run ( Local< Context > context,
Local< Data > host_defined_options )

Definition at line 1906 of file api.cc.

Here is the call graph for this function:

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