1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Update JavascriptEngine documentation

This commit is contained in:
attila 2025-03-28 17:27:21 +01:00 committed by Attila Szarvas
parent 2f5f8d1e7e
commit cac1ad8c1e

View file

@ -36,23 +36,16 @@ namespace juce
{
/**
A simple javascript interpreter!
It's not fully standards-compliant, and won't be as fast as the fancy JIT-compiled
This class is a wrapper around QuickJS, an ES2023 compliant, embeddable javascript
engine. It may not be as fast as the fancy JIT-compiled
engines that you get in browsers, but this is an extremely compact, low-overhead javascript
interpreter, which is integrated with the juce var and DynamicObject classes. If you need
a few simple bits of scripting in your app, and want to be able to easily let the JS
work with native objects defined as DynamicObject subclasses, then this might do the job.
interpreter, which is integrated with the juce var and DynamicObject classes. It allows you
to easily let the JS work with native objects defined as DynamicObject subclasses.
To use, simply create an instance of this class and call execute() to run your code.
Variables that the script sets can be retrieved with evaluate(), and if you need to provide
native objects for the script to use, you can add them with registerNativeObject().
One caveat: Because the values and objects that the engine works with are DynamicObject
and var objects, they use reference-counting rather than garbage-collection, so if your
script creates complex connections between objects, you run the risk of creating cyclic
dependencies and hence leaking.
@tags{Core}
*/
class JUCE_API JavascriptEngine final