V8 Project
v8::StackFrame Class Reference

A single JavaScript stack frame. More...

#include <v8.h>

+ Inheritance diagram for v8::StackFrame:
+ Collaboration diagram for v8::StackFrame:

Public Member Functions

int GetLineNumber () const
 Returns the number, 1-based, of the line for the associate function call. More...
 
int GetColumn () const
 Returns the 1-based column offset on the line for the associated function call. More...
 
int GetScriptId () const
 Returns the id of the script for the function for this StackFrame. More...
 
Local< StringGetScriptName () const
 Returns the name of the resource that contains the script for the function for this StackFrame. More...
 
Local< StringGetScriptNameOrSourceURL () const
 Returns the name of the resource that contains the script for the function for this StackFrame or sourceURL value if the script name is undefined and its source ends with //# sourceURL=... More...
 
Local< StringGetFunctionName () const
 Returns the name of the function associated with this stack frame. More...
 
bool IsEval () const
 Returns whether or not the associated function is compiled via a call to eval(). More...
 
bool IsConstructor () const
 Returns whether or not the associated function is called as a constructor via "new". More...
 

Detailed Description

A single JavaScript stack frame.

Definition at line 1358 of file v8.h.

Member Function Documentation

◆ GetColumn()

int v8::StackFrame::GetColumn ( ) const

Returns the 1-based column offset on the line for the associated function call.

This method will return Message::kNoColumnInfo if it is unable to retrieve the column number, or if kColumnOffset was not passed as an option when capturing the StackTrace.

Definition at line 2306 of file api.cc.

2306  {
2307  return getIntProperty(this, "column", Message::kNoColumnInfo);
2308 }
static const int kNoColumnInfo
Definition: v8.h:1296
static int getIntProperty(const StackFrame *f, const char *propertyName, int defaultValue)
Definition: api.cc:2289

References v8::getIntProperty(), and v8::Message::kNoColumnInfo.

+ Here is the call graph for this function:

◆ GetFunctionName()

Local< String > v8::StackFrame::GetFunctionName ( ) const

Returns the name of the function associated with this stack frame.

Definition at line 2340 of file api.cc.

2340  {
2341  return getStringProperty(this, "functionName");
2342 }
static Local< String > getStringProperty(const StackFrame *f, const char *propertyName)
Definition: api.cc:2316

References v8::getStringProperty().

+ Here is the call graph for this function:

◆ GetLineNumber()

int v8::StackFrame::GetLineNumber ( ) const

Returns the number, 1-based, of the line for the associate function call.

This method will return Message::kNoLineNumberInfo if it is unable to retrieve the line number, or if kLineNumber was not passed as an option when capturing the StackTrace.

Definition at line 2301 of file api.cc.

2301  {
2302  return getIntProperty(this, "lineNumber", Message::kNoLineNumberInfo);
2303 }
static const int kNoLineNumberInfo
Definition: v8.h:1295

References v8::getIntProperty(), and v8::Message::kNoLineNumberInfo.

+ Here is the call graph for this function:

◆ GetScriptId()

int v8::StackFrame::GetScriptId ( ) const

Returns the id of the script for the function for this StackFrame.

This method will return Message::kNoScriptIdInfo if it is unable to retrieve the script id, or if kScriptId was not passed as an option when capturing the StackTrace.

Definition at line 2311 of file api.cc.

2311  {
2312  return getIntProperty(this, "scriptId", Message::kNoScriptIdInfo);
2313 }
static const int kNoScriptIdInfo
Definition: v8.h:1297

References v8::getIntProperty(), and v8::Message::kNoScriptIdInfo.

+ Here is the call graph for this function:

◆ GetScriptName()

Local< String > v8::StackFrame::GetScriptName ( ) const

Returns the name of the resource that contains the script for the function for this StackFrame.

Definition at line 2330 of file api.cc.

2330  {
2331  return getStringProperty(this, "scriptName");
2332 }

References v8::getStringProperty().

+ Here is the call graph for this function:

◆ GetScriptNameOrSourceURL()

Local< String > v8::StackFrame::GetScriptNameOrSourceURL ( ) const

Returns the name of the resource that contains the script for the function for this StackFrame or sourceURL value if the script name is undefined and its source ends with //# sourceURL=...

string or deprecated //@ sourceURL=... string.

Definition at line 2335 of file api.cc.

2335  {
2336  return getStringProperty(this, "scriptNameOrSourceURL");
2337 }

References v8::getStringProperty().

+ Here is the call graph for this function:

◆ IsConstructor()

bool v8::StackFrame::IsConstructor ( ) const

Returns whether or not the associated function is called as a constructor via "new".

Definition at line 2358 of file api.cc.

2358  {
2359  return getBoolProperty(this, "isConstructor");
2360 }
static bool getBoolProperty(const StackFrame *f, const char *propertyName)
Definition: api.cc:2345

References v8::getBoolProperty().

+ Here is the call graph for this function:

◆ IsEval()

bool v8::StackFrame::IsEval ( ) const

Returns whether or not the associated function is compiled via a call to eval().

Definition at line 2355 of file api.cc.

2355 { return getBoolProperty(this, "isEval"); }

References v8::getBoolProperty().

+ Here is the call graph for this function:

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