-
-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Consider this snippet based on broccoli-test-helper:
let tree = new babel("src", { unknownOption: true })
let output = createBuilder(tree)
try {
await output.build()
} finally {
await output.dispose()
}When the tree is processed, Babel will eventually be handed an options object with an unknownOption key and will (rightfully) raise a ReferenceError. So far, no surprises.
As a result, however, the worker process where the error was raised doesn't get terminated even after the Broccoli builder has been cleaned up; the parent Node process will not terminate once work has been exhausted.
My guess is that this is caused by workerpool and not this package, but I'm not familiar enough with that to know whether it behaves as documented or whether it's bugged. On the other hand, it should be fairly simple to implement a workaround by catching errors in lib/worker.js, resolving the promise with the caught error and re-throwing it in lib/parallel-api.js → transformString.