Adds an optional parameter to jsuno::execute to specify a list of global
variables to define in the global scope of the running script. The
values are references to XInterfaces.
Change-Id: I03b7de9fb904f4a172324f0e54c11ff9b0d76134
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205120
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Somewhat loosely based on <https://github.com/allotropia/zetajs>.
Main part that is still missing from this WIP commit is implementing UNO objects
in JS. (And there are a number of TODOs throughout, mostly regarding error
handling.)
===
Comments from Neil Roberts:
This patch was cherry-picked from
1cd8ad398b38763cb3578f1305a28e7774163714 in Collabora’s repo. The
following changes were made in order to get it to pass the CI:
* The unit test has been modified to continue using embindtest instead
of testuno.
* The name of the external library is quickjs instead of qjs because a
different patch is used to add the external QuickJS package.
* The asserts on argc that were captured in the lambda function have been
moved outside of the lambda function in order to avoid having an unused
capture on release builds. The argc parameter has then been marked as
[[maybe_unused]].
* The constructors for JSClassDef have been changed to consistently use
{ } brace initialisers because otherwise it fails to build on macOS.
===
Change-Id: I8810e43fe5f3e4b1a53a654070fe87e95f51231a
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/190
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203963
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>