Skip to content

Commit

Permalink
Add an internal noop function.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 8, 2014
1 parent 59be3cb commit 74b6293
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
var _toString = Function.call.bind(Object.prototype.toString);
var _hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
var ArrayIterator; // make our implementation private
var noop = function () {};

var Symbol = globals.Symbol || {};
var Type = {
Expand Down Expand Up @@ -1554,15 +1555,15 @@
});
var promiseIgnoresNonFunctionThenCallbacks = (function () {
try {
globals.Promise.reject(42).then(null, 5).then(null, function () {});
globals.Promise.reject(42).then(null, 5).then(null, noop);
return true;
} catch (ex) {
return false;
}
}());
var promiseRequiresObjectContext = (function () {
/*global Promise */
try { Promise.call(3, function () {}); } catch (e) { return true; }
try { Promise.call(3, noop); } catch (e) { return true; }
return false;
}());
if (!promiseSupportsSubclassing || !promiseIgnoresNonFunctionThenCallbacks || !promiseRequiresObjectContext) {
Expand Down

0 comments on commit 74b6293

Please sign in to comment.