Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #32 from RReverser/patch-1
Browse files Browse the repository at this point in the history
Fix __awaiter helper to be compatible with TS 1.8
  • Loading branch information
Victorystick committed Mar 7, 2016
2 parents 93203f3 + 31bd1a4 commit a5d8770
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typescript-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export function __param(paramIndex, decorator) {
}

export function __awaiter(thisArg, _arguments, P, generator) {
return new P(function (resolve, reject) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.call(thisArg, _arguments)).next());
step((generator = generator.apply(thisArg, _arguments)).next());
});
}

0 comments on commit a5d8770

Please sign in to comment.