Skip to content

Commit 29ebf16

Browse files
committed
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 e470e5b commit 29ebf16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Dumper/HtmlDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ function xpathHasClass(className) {
371371
if (/\bsf-dump-toggle\b/.test(a.className)) {
372372
e.preventDefault();
373373
if (!toggle(a, isCtrlKey(e))) {
374-
var r = doc.getElementById(a.getAttribute('href').substr(1)),
374+
var r = doc.getElementById(a.getAttribute('href').slice(1)),
375375
s = r.previousSibling,
376376
f = r.parentNode,
377377
t = a.parentNode;
@@ -438,7 +438,7 @@ function xpathHasClass(className) {
438438
toggle(a);
439439
}
440440
} else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {
441-
a = a.substr(1);
441+
a = a.slice(1);
442442
elt.className += ' '+a;
443443
444444
if (/[\[{]$/.test(elt.previousSibling.nodeValue)) {

0 commit comments

Comments
 (0)