Skip to content

Class jac::Module

ClassList > jac > Module

A wrapper around JSModuleDef that allows for easy exporting of values.

  • #include <machine.h>

Public Functions

Type Name
Module (ContextRef ctx, std::string name)
Create a new module in the given context. Should not be called directly, use MachineBase::newModule instead.
Module (const Module &) = delete
Module (Module && other)
void addExport (std::string name, Value val)
Add a value to the module's exports.
JSModuleDef * get ()
Get the underlying JSModuleDef* for this module.
Module & operator= (const Module &) = delete
Module & operator= (Module && other)

Public Functions Documentation

function Module [1/3]

Create a new module in the given context. Should not be called directly, use MachineBase::newModule instead.

jac::Module::Module (
    ContextRef ctx,
    std::string name
) 

Parameters:

  • ctx context to work in
  • name name of the module

function Module [2/3]

jac::Module::Module (
    const Module &
) = delete

function Module [3/3]

inline jac::Module::Module (
    Module && other
) 

function addExport

Add a value to the module's exports.

void jac::Module::addExport (
    std::string name,
    Value val
) 

Parameters:

  • name name of the export
  • val the value to export

function get

Get the underlying JSModuleDef* for this module.

inline JSModuleDef * jac::Module::get () 

Returns:

JSModuleDef*


function operator=

Module & jac::Module::operator= (
    const Module &
) = delete

function operator=

inline Module & jac::Module::operator= (
    Module && other
) 


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