Using
options: {
include: ['String.prototype.endsWith']
}
the task generates this code:
if (!String.prototype.endsWith) {
// String.prototype.endsWith
String.prototype.endsWith = function (string) {
var index = arguments.length < 2 ? this.length : arguments[1];
return this.**indexOf**(string) === index - string.length;
};
}
that is wrong!
It shoud be:
if (!String.prototype.endsWith) {
// String.prototype.endsWith
String.prototype.endsWith = function (string) {
var index = arguments.length < 2 ? this.length : arguments[1];
return this.**lastIndexOf**(string) === index - string.length;
Using options: { include: ['String.prototype.endsWith'] }
the task generates this code: if (!String.prototype.endsWith) { // String.prototype.endsWith String.prototype.endsWith = function (string) { var index = arguments.length < 2 ? this.length : arguments[1];
}; }
that is wrong!
It shoud be: if (!String.prototype.endsWith) { // String.prototype.endsWith String.prototype.endsWith = function (string) { var index = arguments.length < 2 ? this.length : arguments[1];
}; }