8000 Making sure data consumer is a function · arduino/micropython.js@7a2c401 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7a2c401

Browse files
committed
Making sure data consumer is a function
1 parent 418c811 commit 7a2c401

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

micropython.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ class MicroPythonBoard {
189189
}
190190

191191
async execfile(filePath, data_consumer) {
192+
data_consumer = data_consumer || function() {}
192193
if (filePath) {
193194
const content = fs.readFileSync(path.resolve(filePath))
194195
await this.enter_raw_repl()
@@ -302,6 +303,7 @@ class MicroPythonBoard {
302303
}
303304

304305
async fs_save(content, dest, data_consumer) {
306+
data_consumer = data_consumer || function() {}
305307
if (content && dest) {
306308
content = fixLineBreak(content)
307309
await this.enter_raw_repl()

0 commit comments

Comments
 (0)
0