JavaScriptEngineMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

JavaScriptEngineMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class JavaScript MBS Tools Plugin 20.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The class for our embedded JavaScript engine.

We use DukTape, an embeddable Javascript engine, with a focus on portability and compact footprint.
https://duktape.org

Your own JavaScript engine is useful for:


MBS Plugin added Input(), Yield() and Print() functions for your convenience.
Yield will pass CPU control to other threads, so background tasks continue to run.

MBS Plugin can convert JavaScript values to variant.
Boolean -> Boolean
Number -> Double
String -> String
Buffer -> MemoryBlock
Pointer -> Ptr
Array -> Variant array
Object -> JSON string
null -> nil

We convert variant to JavaScript:
nil -> null
Int32, Int64, Single, Double, Currency -> Number
Boolean -> Boolean
String, Text, Date -> String
Ptr -> Pointer
all other -> undefined

This class is like XojoScript, but using JavaScript as language.

Warning: error handling is broken in version 21.1 of the MBS Plugin. Please update to 22.2 for a fix.

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Videos

Release notes


The items on this page are in the following plugins: MBS Tools Plugin.


JavaScriptEngineExceptionMBS   -   JavaShortArrayMBS


💬 Ask a question or report a problem