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

Commit ff208e2

Browse files
committed
Add hack to deal with microbundle scoping issues
ref #182
1 parent 457886b commit ff208e2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/rude-turtles-grab.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 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
@@ -121,12 +121,14 @@ export const extractParameters = ixType => {
121121
* @returns {Promise<any>}
122122
*/
123123
export const sendTransaction = async (...props) => {
124+
// This is here to fix an issue with microbundler confusing argument scopes
125+
let _props = props
124126
let result = null,
125127
err = null
126128
const logs = await captureLogs(async () => {
127129
try {
128130
const extractor = extractParameters("tx")
129-
const {code, args, signers, limit} = await extractor(props)
131+
const {code, args, signers, limit} = await extractor(_props)
130132

131133
const serviceAuth = authorization()
132134

0 commit comments

Comments
 (0)