Skip to content

Commit 13a299f

Browse files
jacebrowningdavehunt
authored andcommitted
Add implementation of 'includes' for PhantomJS
https://stackoverflow.com/a/31361163/429533
1 parent d81d156 commit 13a299f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

testing/test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
33
* You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
if (!String.prototype.includes) {
6+
String.prototype.includes = function() {'use strict';
7+
return String.prototype.indexOf.apply(this, arguments) !== -1;
8+
};
9+
}
10+
511
QUnit.module( 'module', {
612
beforeEach: function( assert ) {
713
init();

0 commit comments

Comments
 (0)