v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
Script Class Reference

#include <v8-script.h>

Inheritance diagram for Script:
Collaboration diagram for 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
 
- Public Member Functions inherited from Data
bool IsValue () const
 
bool IsModule () 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 329 of file v8-script.h.

Member Function Documentation

◆ Compile()

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

A shorthand for ScriptCompiler::Compile().

◆ GetProducedCompileHints()

std::vector< int > GetProducedCompileHints ( ) const

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

◆ GetResourceName()

Local< Value > GetResourceName ( )

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

◆ GetUnboundScript()

Local< UnboundScript > GetUnboundScript ( )

Returns the corresponding context-unbound script.

◆ Run() [1/2]

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

◆ Run() [2/2]

V8_WARN_UNUSED_RESULT MaybeLocal< Value > Run ( Local< Context context,
Local< Data host_defined_options 
)

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