diff --git a/spec/observables/forkJoin-spec.ts b/spec/observables/forkJoin-spec.ts index 0bbb31211e..8d437f38b5 100644 --- a/spec/observables/forkJoin-spec.ts +++ b/spec/observables/forkJoin-spec.ts @@ -504,5 +504,18 @@ describe('forkJoin', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); }); + + it('should accept promise as the first arg', done => { + const e1 = forkJoin(Promise.resolve(1)); + const values: number[][] = []; + + e1.subscribe({ + next: x => values.push(x), + complete: () => { + expect(values).to.deep.equal([[1]]); + done(); + } + }); + }); }); }); diff --git a/src/internal/observable/forkJoin.ts b/src/internal/observable/forkJoin.ts index a7a8d3453a..400e54f8ef 100644 --- a/src/internal/observable/forkJoin.ts +++ b/src/internal/observable/forkJoin.ts @@ -147,7 +147,7 @@ export function forkJoin( return forkJoinInternal(first, null); } // TODO(benlesh): isObservable check will not be necessary when deprecated path is removed. - if (isObject(first) && !isObservable(first)) { + if (isObject(first) && Object.getPrototypeOf(first) === Object.prototype) { const keys = Object.keys(first); return forkJoinInternal(keys.map(key => first[key]), keys); }