mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
Use Boolean to fake out the isNative check and allow environments to test the native String#contains fork of _.contains
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
Object.keys = function() {};
|
||||
|
||||
String.prototype._contains = String.prototype.contains;
|
||||
String.prototype.contains = function() {};
|
||||
String.prototype.contains = String.prototype._contains ? function() {} : Boolean;
|
||||
|
||||
window.WinRTError = Error;
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
Object.keys = function() {};
|
||||
|
||||
var _contains = String.prototype.contains;
|
||||
String.prototype.contains = function() {};
|
||||
String.prototype.contains = _contains ? function() {} : Boolean;
|
||||
|
||||
// load Lo-Dash and expose it to the bad extensions/shims
|
||||
lodashBizarro = (lodashBizarro = require(filePath))._ || lodashBizarro;
|
||||
@@ -275,8 +275,8 @@
|
||||
Object.getPrototypeOf = _getPrototypeOf;
|
||||
Object.keys = _keys;
|
||||
|
||||
if (String.prototype._contains) {
|
||||
String.prototype.contains = String.prototype._contains;
|
||||
if (_contains) {
|
||||
String.prototype.contains = _contains;
|
||||
} else {
|
||||
delete String.prototype.contains;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user