diff options
-rw-r--r-- | static/README.wasm.md | 8 | ||||
-rw-r--r-- | static/source/embindmaker/embindmaker.cxx | 3 | ||||
-rw-r--r-- | unotest/source/embindtest/embindtest.js | 5 |
3 files changed, 7 insertions, 9 deletions
diff --git a/static/README.wasm.md b/static/README.wasm.md index e37242508b72..f2abc8219ce8 100644 --- a/static/README.wasm.md +++ b/static/README.wasm.md @@ -223,8 +223,8 @@ improvement! ;) Some usage examples through javascript of the current implementation: ```js // inserts a string at the start of the Writer document. -init_unoembind_uno(Module); -let css = Module.unoembind_uno.com.sun.star; +let uno = init_unoembind_uno(Module); +let css = uno.com.sun.star; xModel = Module.getCurrentModelFromViewSh(); xTextDocument = new css.text.XTextDocument(xModel.$query()); xText = xTextDocument.getText(); @@ -238,8 +238,8 @@ xModel.delete(); xTextDocument.delete(); xText.delete(); xSimpleText.delete(); x ```js // changes each paragraph of the Writer document to a random color. -init_unoembind_uno(Module); -let css = Module.unoembind_uno.com.sun.star; +let uno = init_unoembind_uno(Module); +let css = uno.com.sun.star; xModel = Module.getCurrentModelFromViewSh(); xEnumAccess = new css.container.XEnumerationAccess(xText.$query()); xParaEnumeration = xEnumAccess.createEnumeration(); diff --git a/static/source/embindmaker/embindmaker.cxx b/static/source/embindmaker/embindmaker.cxx index 335b7983503c..37175d100cdf 100644 --- a/static/source/embindmaker/embindmaker.cxx +++ b/static/source/embindmaker/embindmaker.cxx @@ -955,8 +955,7 @@ SAL_IMPLEMENT_MAIN() } jsOut << "function init_unoembind_" << name << "(instance) {\n" - " instance.unoembind_" - << name << " = {\n"; + " return {\n"; writeJsMap(jsOut, *module, " "); jsOut << " };\n" "};\n"; diff --git a/unotest/source/embindtest/embindtest.js b/unotest/source/embindtest/embindtest.js index 3d3196cc4c39..146be3fa545a 100644 --- a/unotest/source/embindtest/embindtest.js +++ b/unotest/source/embindtest/embindtest.js @@ -9,9 +9,8 @@ Module.addOnPostRun(function() { console.log('Running embindtest'); - init_unoembind_uno(Module); - let test = new Module.unoembind_uno.org.libreoffice.embindtest.Test( - Module.getUnoComponentContext()); + let uno = init_unoembind_uno(Module); + let test = new uno.org.libreoffice.embindtest.Test(Module.getUnoComponentContext()); console.assert(typeof test === 'object'); { let v = test.getBoolean(); |