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:
John-David Dalton
2013-12-20 02:38:18 -08:00
parent 3c72ea40b4
commit d34cf636d8
2 changed files with 4 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;
}