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 facebook#5794

Reviewed By: svcscm

Differential Revision: D2910855

Pulled By: vjeux

fb-gh-sync-id: 8fd216222385f038995d1ed10e8a2c4c34c7e928
  • Loading branch information
vjeux authored and pglotov committed Mar 15, 2016
1 parent 2eef4a9 commit 32465fc
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 32465fc

Please sign in to comment.