Add bad shim tests for String#contains and remove those for Function#bind as we don't use native bind.

This commit is contained in:
John-David Dalton
2013-12-19 02:05:55 -08:00
parent 8459117c23
commit f3931140fe
2 changed files with 28 additions and 17 deletions

View File

@@ -29,9 +29,6 @@
Date._now = Date.now;
Date.now = function() {};
Function.prototype._bind = Function.prototype.bind;
Function.prototype.bind = function() { return function() {}; };
Object._create = Object.create;
Object.create = function() {};
@@ -44,6 +41,9 @@
Object._keys = Object.keys;
Object.keys = function() {};
String.prototype._contains = String.prototype.contains;
String.prototype.contains = function() {};
window.WinRTError = Error;
document._createDocumentFragment = document.createDocumentFragment;
@@ -61,11 +61,6 @@
} else {
delete Date.now;
}
if (Function.prototype._bind) {
Function.prototype.bind = Function.prototype._bind;
} else {
delete Function.prototype.bind;
}
if (Object._create) {
Object.create = Object._create;
} else {
@@ -86,6 +81,11 @@
} else {
delete Object.keys;
}
if (String.prototype._contains) {
String.prototype.contains = String.prototype._contains;
} else {
delete String.prototype.contains;
}
window.WinRTError = undefined;
document.createDocumentFragment = document._createDocumentFragment;
@@ -93,12 +93,12 @@
delete Array._isArray;
delete Date._now;
delete Function.prototype._bind;
delete Function.prototype._method;
delete Object._create;
delete Object._defineProperty;
delete Object._getPrototypeOf;
delete Object._keys;
delete String.prototype._contains;
}
addBizarroMethods();