like-thread 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -3
- package/package.json +1 -1
- package/worker.js +1 -1
package/index.js
CHANGED
|
@@ -102,6 +102,8 @@ module.exports = class Thread {
|
|
|
102
102
|
}
|
|
103
103
|
})
|
|
104
104
|
})
|
|
105
|
+
|
|
106
|
+
this.promise.catch(noop)
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
_onMessage (msg) {
|
|
@@ -287,8 +289,8 @@ module.exports = class Thread {
|
|
|
287
289
|
async close () {
|
|
288
290
|
this.worker.postMessage({ command: 'exit' })
|
|
289
291
|
|
|
290
|
-
await this.promise
|
|
291
|
-
|
|
292
|
-
// await this.worker.terminate()
|
|
292
|
+
await this.promise.catch(noop)
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
+
|
|
296
|
+
function noop () {}
|
package/package.json
CHANGED