Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

use instanceof to determine whether an object is a Q promise inside function Q #566

Merged
merged 2 commits into from
Sep 11, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion q.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ function Q(value) {
// If the object is already a Promise, return it directly. This enables
// the resolve function to both be used to created references from objects,
// but to tolerably coerce non-promises to promises.
if (isPromise(value)) {
if (value instanceof Promise) {
return value;
}

Expand Down