Sfoglia il codice sorgente

fix: deepfreeze check by prop (#5407)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Pedro Luiz Cabral Salomon Prado 2 anni fa
parent
commit
49f06ca4b9
2 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 5 0
      .changes/fix-tauri-pattern-freeze.md
  2. 2 2
      core/tauri/scripts/pattern.js

+ 5 - 0
.changes/fix-tauri-pattern-freeze.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Fixes `__TAURI_PATTERN__` object freeze.

+ 2 - 2
core/tauri/scripts/pattern.js

@@ -7,8 +7,8 @@
     const props = Object.getOwnPropertyNames(object)
 
     for (const prop of props) {
-      if (typeof object[name] === 'object') {
-        __tauriDeepFreeze(object[name])
+      if (typeof object[prop] === 'object') {
+        __tauriDeepFreeze(object[prop])
       }
     }