Skip to content

Commit 263a870

Browse files
CommanderRootJonathan Ginsburg
authored andcommitted
refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
1 parent 1b6ded5 commit 263a870

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

static/context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ exports.isDefined = function (value) {
123123

124124
exports.parseQueryParams = function (locationSearch) {
125125
var params = {}
126-
var pairs = locationSearch.substr(1).split('&')
126+
var pairs = locationSearch.slice(1).split('&')
127127
var keyValue
128128

129129
for (var i = 0; i < pairs.length; i++) {

static/karma.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ var socket = io(location.host, {
348348
reconnectionDelay: 500,
349349
reconnectionDelayMax: Infinity,
350350
timeout: BROWSER_SOCKET_TIMEOUT,
351-
path: KARMA_PROXY_PATH + KARMA_URL_ROOT.substr(1) + 'socket.io',
351+
path: KARMA_PROXY_PATH + KARMA_URL_ROOT.slice(1) + 'socket.io',
352352
'sync disconnect on unload': true,
353353
useNativeTimers: true
354354
})
@@ -565,7 +565,7 @@ exports.isDefined = function (value) {
565565

566566
exports.parseQueryParams = function (locationSearch) {
567567
var params = {}
568-
var pairs = locationSearch.substr(1).split('&')
568+
var pairs = locationSearch.slice(1).split('&')
569569
var keyValue
570570

571571
for (var i = 0; i < pairs.length; i++) {

0 commit comments

Comments
 (0)