From c8b167adb3561db182bc8f6e4d8753ce1ae3f450 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sat, 17 Oct 2020 21:02:32 -0300 Subject: [PATCH] fix(tauri.js) promisified API fails on Reflect.deleteProperty, fix #1038 (#1056) --- .changes/delete-property.md | 5 + cli/tauri.js/api-src/tauri.ts | 3 +- .../communication/dist/index.tauri.html | 630 ++++++------------ 3 files changed, 229 insertions(+), 409 deletions(-) create mode 100644 .changes/delete-property.md diff --git a/.changes/delete-property.md b/.changes/delete-property.md new file mode 100644 index 000000000..a41e37d2f --- /dev/null +++ b/.changes/delete-property.md @@ -0,0 +1,5 @@ +--- +"tauri.js": patch +--- + +Fixes `Reflect.deleteProperty` on promisified API calls failing with `Unable to delete property` by making it configurable. diff --git a/cli/tauri.js/api-src/tauri.ts b/cli/tauri.js/api-src/tauri.ts index 30ca424ae..f7e81c34f 100644 --- a/cli/tauri.js/api-src/tauri.ts +++ b/cli/tauri.js/api-src/tauri.ts @@ -50,7 +50,8 @@ function transformCallback( return callback?.(result) }, - writable: false + writable: false, + configurable: true }) return identifier diff --git a/tauri/examples/communication/dist/index.tauri.html b/tauri/examples/communication/dist/index.tauri.html index 31c619db2..9bf431668 100644 --- a/tauri/examples/communication/dist/index.tauri.html +++ b/tauri/examples/communication/dist/index.tauri.html @@ -1,4 +1,4 @@ - - - - - -
- -
- -
-
-
- - -
- - - - - -
- - -
-
-
-
- - -
-
- - - -
-
- - -
- - -
-
- - -
- - - -
-
-
- -
- - -
-
- - -
- -
- - -
- -
- -
-
-
-
- - -
-
- -
-
-
-
-
-
-
- Tauri Documentation    - Github Repo    - Source for this App -
- - - - - - - - + var observer = new MutationObserver(mutation => { + mutation.forEach(function (mutationRecord) { + var addedNodes = mutationRecord.addedNodes + addedNodes.forEach(function (node) { + if (node.nodeType === 1) { + if (node.tagName === 'SCRIPT') { + node.onload = node.onerror = null + loadAsset(node.src) + } else if (node.tagName === 'LINK') { + if (node.type === 'text/css' || (node.href && node.href.endsWith('.css'))) { + loadAsset(node.href, 'stylesheet') + } + } + } + }) + }) + }) + + var target = document.documentElement + - - \ No newline at end of file + observer.observe(target, { + childList: true, + subtree: true + }) +})() +


Tauri Documentation    Github Repo    Source for this App
\ No newline at end of file