Skip to content

Commit

Permalink
FIX DEOPT:wrong-map of StreamHelpers::joinHelper
Browse files Browse the repository at this point in the history
Higher impact on es6 build
Switching yield* to for-of + yield still comes with DEOPT
Manually handling yield* solves the DEOPT
  • Loading branch information
dubzzz committed Oct 10, 2018
1 parent c4217b0 commit 289c4c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/stream/StreamHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ export function* takeWhileHelper<T>(g: IterableIterator<T>, f: (v: T) => boolean

/** @hidden */
export function* joinHelper<T>(g: IterableIterator<T>, others: IterableIterator<T>[]): IterableIterator<T> {
yield* g;
for (let cur = g.next(); !cur.done; cur = g.next()) {
yield cur.value;
}
for (const s of others) {
yield* s;
for (let cur = s.next(); !cur.done; cur = s.next()) {
yield cur.value;
}
}
}

0 comments on commit 289c4c1

Please sign in to comment.