diff --git a/npm/publish-wiki.js b/npm/publish-wiki.js index f65351097..521a1ba7f 100644 --- a/npm/publish-wiki.js +++ b/npm/publish-wiki.js @@ -51,7 +51,7 @@ module.exports = function (exit) { sidebar = source.replace(/<\/a>[\s\S]+/g, ''); // remove sidebar data from home - home = source.substr(sidebar.length); + home = source.substring(sidebar.length); // add timestamp to sidebar sidebar += '\n\n ' + (new Date()).toUTCString(); diff --git a/npm/server.js b/npm/server.js index e15ee4cb4..6ec6c1124 100644 --- a/npm/server.js +++ b/npm/server.js @@ -93,7 +93,7 @@ function createRedirectServer () { } // path: /status/ else if ((/^\/status\/(\d{3})$/).test(req.url)) { - res.writeHead(parseInt(req.url.substr(-3), 10), { location: '/' }); + res.writeHead(parseInt(req.url.substring(req.url.length - 3), 10), { location: '/' }); return res.end(); } diff --git a/npm/test-cli.js b/npm/test-cli.js index 68b32c607..61826f1f6 100755 --- a/npm/test-cli.js +++ b/npm/test-cli.js @@ -31,7 +31,7 @@ module.exports = function (exit) { var _exec = global.exec; // need to restore it later files.filter(function (file) { - return (file.substr(-8) === '.test.js'); + return (file.substring(file.length - 8) === '.test.js'); }).forEach(function (file) { mocha.addFile(file); }); diff --git a/npm/test-library.js b/npm/test-library.js index 33e8473f0..77f85562d 100755 --- a/npm/test-library.js +++ b/npm/test-library.js @@ -28,7 +28,7 @@ module.exports = function (exit) { } files.filter(function (file) { - return (file.substr(-8) === '.test.js'); + return (file.substring(file.length - 8) === '.test.js'); }).forEach(function (file) { mocha.addFile(file); }); diff --git a/npm/test-system.js b/npm/test-system.js index 9a30e6cf8..d28ad5c32 100755 --- a/npm/test-system.js +++ b/npm/test-system.js @@ -51,7 +51,7 @@ module.exports = function (exit) { } files.filter(function (file) { - return (file.substr(-8) === '.test.js'); + return (file.substring(file.length - 8) === '.test.js'); }).forEach(function (file) { mocha.addFile(file); }); diff --git a/npm/test-unit.js b/npm/test-unit.js index 09fab45ab..e09092d66 100755 --- a/npm/test-unit.js +++ b/npm/test-unit.js @@ -31,7 +31,7 @@ module.exports = function (exit) { var mocha = new Mocha({ timeout: 1000 * 60 }); files.filter(function (file) { // extract all test files - return (file.substr(-8) === '.test.js'); + return (file.substring(file.length - 8) === '.test.js'); }).forEach(mocha.addFile.bind(mocha)); // start the mocha run