Skip to content

Struct jac::ProtoBuilder::Callable

ClassList > jac > ProtoBuilder > Callable

A base class for javascript classes with callable instances. More...

  • #include <class.h>

Public Static Functions

Type Name
Value callConstructor (ContextRef ctx, ValueWeak funcObj, ValueWeak target, std::vector< ValueWeak > args)
Process a call to the wrapped class as a constructor.
Value callFunction (ContextRef ctx, ValueWeak funcObj, ValueWeak thisVal, std::vector< ValueWeak > args)
Process a call to the wrapped class.

Detailed Description

The functions callFunction and callConstructor can be overriden to provide custom handling of the class instance when it's called as a function or as a constructor (with new).

Public Static Functions Documentation

function callConstructor

Process a call to the wrapped class as a constructor.

static inline Value jac::ProtoBuilder::Callable::callConstructor (
    ContextRef ctx,
    ValueWeak funcObj,
    ValueWeak target,
    std::vector< ValueWeak > args
) 

Parameters:

  • ctx context to work in
  • funcObj instance of the class
  • target value of new.target in the function
  • args arguments passed to the function

Returns:

Result of the call

function callFunction

Process a call to the wrapped class.

static inline Value jac::ProtoBuilder::Callable::callFunction (
    ContextRef ctx,
    ValueWeak funcObj,
    ValueWeak thisVal,
    std::vector< ValueWeak > args
) 

Parameters:

  • ctx context to work in
  • funcObj instance of the class
  • thisVal value of this in the function
  • args arguments passed to the function

Returns:

result of the call


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