Open BlackYoup opened 7 years ago
The same happens when any non-observable value is given as an argument for Bacon.mergeAll
. An assertion there could be appropriate that every item in streams
extracted from arguments is an observable.
You're not seeing mergeAll
in the stack trace as the event stream is initialised when there is a subscription. The topmost line in the stack trace (Bacon.js:3122:21) is within Bacon.mergeAll source.
The same happens when any non-observable value is given as an argument for Bacon.mergeAll.
Yeah, I saw that right after the report. Will update the title
An assertion there could be appropriate that every item in streams extracted from arguments is an observable.
An assertion would be useful, not sure how much overhead this implies though
You're not seeing mergeAll in the stack trace as the event stream is initialised when there is a subscription. The topmost line in the stack trace (Bacon.js:3122:21) is within Bacon.mergeAll source.
Yep, that's mostly why I opened the issue, there is no reference of the called function that triggers the error.
There is some assertions in the codebase. They cause overhead, but that hasn't been a big problem as you can use the noAssert build when needed. assemble.js
strips out all function calls to functions that are named assert*
.
There isn't an assertion that would run on arrays, only single items. It might be needed to create one to get also the loop removed from the build.
Hi,
I just had a problem with
Bacon.mergeAll()
returning a cryptic error when one of its arguments is undefined.Example:
Output:
There is no mention of the
mergeAll
call in the stack trace, so it might be hard to understand where the error comes from without reading the source code. This is with the last version of Bacon (and even a few before that one).I would be happy to open a PR for this, but I'm not really sure on how to do such fix right now.
Thank you :-)