Skip to content

Commit

Permalink
Fix sinonjs#2316: handle absent Promise
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov committed Dec 5, 2020
1 parent e3a8fca commit a9c9e15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sinon/fake.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ function wrapFunc(f) {
}

function fakeClass() {
var promiseLib = Promise;
var promiseLib = null;
if (typeof Promise === "function") {
promiseLib = Promise;
}

function fake(f) {
if (arguments.length > 0 && typeof f !== "function") {
Expand Down

0 comments on commit a9c9e15

Please sign in to comment.