Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
crossjs committed Nov 17, 2016
1 parent 87aa7ac commit 4d0b93c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ const setImmediate = require('core-js/library/fn/set-immediate')
function Nuo (fn) {
if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new')
if (typeof fn !== 'function') throw new TypeError('The first argument must be a function')
// state
this._s = null
// value
this._v = null
// progress
this._p = null
// deferred
this._d = []

doResolve(fn, (...args) => {
Expand Down

0 comments on commit 4d0b93c

Please sign in to comment.