Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 1ce23f0

Browse files
authored
Fix passing props when executing script (#190)
* Fix execute script props * Add changeset
1 parent f905016 commit 1ce23f0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/brown-bugs-fry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@onflow/flow-js-testing": patch
3+
---
4+
5+
Add explicit scoping to arguments for scripts in nested await functions to hint microbunde into doing the right thing

src/interaction.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,14 @@ export const sendTransaction = async (...props) => {
171171
* @returns {Promise<*>}
172172
*/
173173
export const executeScript = async (...props) => {
174+
// This is here to fix an issue with microbundler confusing argument scopes
175+
let _props = props
174176
let result = null,
175177
err = null
176178
const logs = await captureLogs(async () => {
177179
try {
178180
const extractor = extractParameters("script")
179-
const {code, args, limit} = await extractor(props)
181+
const {code, args, limit} = await extractor(_props)
180182

181183
const ix = [fcl.script(code), fcl.limit(limit)]
182184
// add arguments if any

0 commit comments

Comments
 (0)