mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Update JavascriptEngine documentation
This commit is contained in:
parent
2f5f8d1e7e
commit
cac1ad8c1e
1 changed files with 4 additions and 11 deletions
|
|
@ -36,23 +36,16 @@ namespace juce
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A simple javascript interpreter!
|
This class is a wrapper around QuickJS, an ES2023 compliant, embeddable javascript
|
||||||
|
engine. It may not be as fast as the fancy JIT-compiled
|
||||||
It's not fully standards-compliant, and won't be as fast as the fancy JIT-compiled
|
|
||||||
engines that you get in browsers, but this is an extremely compact, low-overhead javascript
|
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
|
interpreter, which is integrated with the juce var and DynamicObject classes. It allows you
|
||||||
a few simple bits of scripting in your app, and want to be able to easily let the JS
|
to easily let the JS work with native objects defined as DynamicObject subclasses.
|
||||||
work with native objects defined as DynamicObject subclasses, then this might do the job.
|
|
||||||
|
|
||||||
To use, simply create an instance of this class and call execute() to run your code.
|
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
|
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().
|
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}
|
@tags{Core}
|
||||||
*/
|
*/
|
||||||
class JUCE_API JavascriptEngine final
|
class JUCE_API JavascriptEngine final
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue