Skip to content
SiteEmail

cohtml.Net.ScriptCompiler

Inherits from SystemIDisposable

Name
enum classScriptType { ST_Classic, ST_Module}
The enumeration tells the ScriptCompiler how to compile the provided source.
Name
virtual voidDispose()
virtual DataBufferCompile(DataBuffer utf8Source, ScriptCompiler.ScriptType scriptType)
Compiles a script file synchronously.
virtual voidDestroy()
Destroys the ScriptCompiler and frees memory.
Name
boolswigCMemOwn
EnumeratorValueDescription
ST_ClassicTry to compile the provided source as a classic script.
ST_ModuleTry to compile the provided source as a module.

The enumeration tells the ScriptCompiler how to compile the provided source.

virtual void Dispose()
virtual DataBuffer Compile(
DataBuffer utf8Source,
ScriptCompiler.ScriptType scriptType
)

Compiles a script file synchronously.

Parameters:

  • utf8Source a data buffer, containing an utf8 encoded script source
  • scriptType specify if the provided source is classic script or module

Return: A data buffer, containing the compiled data.

Note: Scripts can be precompiled on Windows then later used on other platforms where Cohtml works with V8’s pointer compression feature enabled. Currently, those are only Microsoft Xbox consoles.

virtual void Destroy()

Destroys the ScriptCompiler and frees memory.

bool swigCMemOwn;