Skip to content

Commit b833ab0

Browse files
committed
Better error message.
1 parent e0baa30 commit b833ab0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/generators/disposable.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import that from "../that.js";
22

33
export default function disposable(value, dispose) {
44
let done = false;
5+
if (typeof dispose !== "function") {
6+
throw new Error("dispose is not a function");
7+
}
58
return {
69
[Symbol.iterator]: that,
710
next: () => done ? {done: true} : (done = true, {done: false, value}),

0 commit comments

Comments
 (0)