mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +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() {};
|
Object.keys = function() {};
|
||||||
|
|
||||||
String.prototype._contains = String.prototype.contains;
|
String.prototype._contains = String.prototype.contains;
|
||||||
String.prototype.contains = function() {};
|
String.prototype.contains = String.prototype._contains ? function() {} : Boolean;
|
||||||
|
|
||||||
window.WinRTError = Error;
|
window.WinRTError = Error;
|
||||||
|
|
||||||
|
|||||||
@@ -262,7 +262,7 @@
|
|||||||
Object.keys = function() {};
|
Object.keys = function() {};
|
||||||
|
|
||||||
var _contains = String.prototype.contains;
|
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
|
// load Lo-Dash and expose it to the bad extensions/shims
|
||||||
lodashBizarro = (lodashBizarro = require(filePath))._ || lodashBizarro;
|
lodashBizarro = (lodashBizarro = require(filePath))._ || lodashBizarro;
|
||||||
@@ -275,8 +275,8 @@
|
|||||||
Object.getPrototypeOf = _getPrototypeOf;
|
Object.getPrototypeOf = _getPrototypeOf;
|
||||||
Object.keys = _keys;
|
Object.keys = _keys;
|
||||||
|
|
||||||
if (String.prototype._contains) {
|
if (_contains) {
|
||||||
String.prototype.contains = String.prototype._contains;
|
String.prototype.contains = _contains;
|
||||||
} else {
|
} else {
|
||||||
delete String.prototype.contains;
|
delete String.prototype.contains;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user