Remove String.prototype.contains polyfill
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 https://github.com/facebook/react-native/pull/5794 Reviewed By: svcscm Differential Revision: D2910855 Pulled By: vjeux fb-gh-sync-id: 8fd216222385f038995d1ed10e8a2c4c34c7e928
This commit is contained in:
parent
3e1f1ea7bb
commit
577206fe51
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue