mrdocs::js::Scope::eval

Compile and run a expression.

Synopsis

Declared in <mrdocs/Support/JavaScript.hpp>

Expected<Value>
eval(std::string_view jsCode);

Description

This function compiles and executes the specified JavaScript code. The script can be used to execute commands or define global variables in the parent context.

It evaluates the ECMAScript source code and converts any internal errors to Error.

Return Value

A container holding an error or a value.

Parameters

Name Description

jsCode

The JavaScript code to execute.

Created with MrDocs