Skip to content

Commit

Permalink
v2.0.0: Removed automatic polypill. Added Promise.immediateFn to allo…
Browse files Browse the repository at this point in the history
…w changing immediateFn without setImmediate polyfill
  • Loading branch information
Taylor Hakes committed Feb 3, 2015
1 parent 3afb9fb commit 9709964
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions Promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@
root = global;
}

if (typeof module !== 'undefined' && module.exports) {
module.exports = root.Promise ? root.Promise : Promise;
} else if (!root.Promise) {
root.Promise = Promise;
}

// Use polyfill for setImmediate for performance gains
var asap = root.setImmediate || function(fn) { setTimeout(fn, 1); };
var asap = Promise.immediateFn || root.setImmediate || function(fn) { setTimeout(fn, 1); };

// Polyfill for Function.prototype.bind
function bind(fn, thisArg) {
Expand Down Expand Up @@ -183,4 +177,10 @@
}
});
};

if (typeof module !== 'undefined' && module.exports) {
module.exports = Promise;
} else if (!root.Promise) {
root.Promise = Promise;
}
})();
4 changes: 2 additions & 2 deletions Promise.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "promise-polyfill",
"version": "1.1.6",
"version": "2.0.0",
"description": "Lightweight promise polyfill. A+ compliant",
"main": "Promise.js",
"scripts": {
Expand Down

0 comments on commit 9709964

Please sign in to comment.