Skip to content

Class jac::ContextRef

ClassList > jac > ContextRef

A wrapper around JSContext* providing some related functionality.

  • #include <context.h>

Public Functions

Type Name
ContextRef (JSContext * ctx)
JSContext * get ()
Get the underlying JSContext*.
Exception getException ()
Get pending exception thrown in this context.
Object getGlobalObject ()
Get the global object of this context.
operator JSContext * ()
operator JSContext * () const
operator bool ()
ContextRef operator= (JSContext * ctx)

Public Functions Documentation

function ContextRef

inline jac::ContextRef::ContextRef (
    JSContext * ctx
) 

function get

Get the underlying JSContext*.

inline JSContext * jac::ContextRef::get () 

Returns:

The JSContext*

function getException

Get pending exception thrown in this context.

Exception jac::ContextRef::getException () 

Note:

If there is no pending exception, new Exception will be thrown

Returns:

The Exception

function getGlobalObject

Get the global object of this context.

Object jac::ContextRef::getGlobalObject () 

Returns:

The global object

function operator JSContext * [1/2]

inline jac::ContextRef::operator JSContext * () 

function operator JSContext * [2/2]

inline jac::ContextRef::operator JSContext * () const

function operator bool

inline jac::ContextRef::operator bool () 

function operator=

inline ContextRef jac::ContextRef::operator= (
    JSContext * ctx
) 

The documentation for this class was generated from the following file src/jac/machine/context.h