Skip to content

Commit

Permalink
Remove String.prototype.contains polyfill
Browse files Browse the repository at this point in the history
Summary:
Now that String.prototype.includes is there, we should remove the .contains one which has not been standardized.

For fb reviewers, this needs to land after D2910339 which updates internal callsites.
Closes #5794

Reviewed By: svcscm

Differential Revision: D2910855

Pulled By: vjeux

fb-gh-sync-id: 8fd216222385f038995d1ed10e8a2c4c34c7e928
  • Loading branch information
vjeux authored and facebook-github-bot-7 committed Feb 8, 2016
1 parent 3e1f1ea commit 577206f
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,6 @@ if (!String.prototype.endsWith) {
};
}

if (!String.prototype.contains) {
String.prototype.contains = function(search) {
'use strict';
if (this == null) {
throw TypeError();
}
var string = String(this);
var pos = arguments.length > 1 ?
(Number(arguments[1]) || 0) : 0;
return string.indexOf(String(search), pos) !== -1;
};
}

if (!String.prototype.repeat) {
String.prototype.repeat = function(count) {
'use strict';
Expand Down

0 comments on commit 577206f

Please sign in to comment.