Skip to content

Commit 59971a8

Browse files
committed
Move off of deprecated substr
1 parent 125457f commit 59971a8

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

6502.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ export class Cpu6502 extends Base6502 {
13251325
const dis = disassembler.disassemble(pc, true)[0];
13261326
console.log(
13271327
utils.hexword(pc),
1328-
(dis + " ").substr(0, 15),
1328+
(dis + " ").substring(0, 15),
13291329
utils.hexbyte(a),
13301330
utils.hexbyte(x),
13311331
utils.hexbyte(y),

config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class Config {
5353
}
5454

5555
setKeyLayout(keyLayout) {
56-
$(".keyboard-layout").text(keyLayout[0].toUpperCase() + keyLayout.substr(1));
56+
$(".keyboard-layout").text(keyLayout[0].toUpperCase() + keyLayout.substring(1));
5757
}
5858

5959
set65c02(enabled) {

utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export function isFirefox() {
1010
}
1111

1212
export function parseAddr(s) {
13-
if (s[0] === "$" || s[0] === "&") return parseInt(s.substr(1), 16);
14-
if (s.indexOf("0x") === 0) return parseInt(s.substr(2), 16);
13+
if (s[0] === "$" || s[0] === "&") return parseInt(s.substring(1), 16);
14+
if (s.indexOf("0x") === 0) return parseInt(s.substring(2), 16);
1515
return parseInt(s, 16);
1616
}
1717

web/debug.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export class Debugger {
271271
let addr = parseInt(ops[0], 16);
272272
const setTo = ops[1];
273273
for (let i = 0; i < setTo.length; i += 2) {
274-
const b = parseInt(setTo.substr(i, 2), 16);
274+
const b = parseInt(setTo.substring(i, 2), 16);
275275
this.cpu.writemem(addr, b);
276276
addr++;
277277
}
@@ -280,8 +280,8 @@ export class Debugger {
280280
setPatch(patch) {
281281
_.each(patch.split(";"), (inst) => {
282282
if (inst[0] === "@") {
283-
const at = parseInt(inst.substr(1, 4), 16);
284-
inst = inst.substr(5);
283+
const at = parseInt(inst.substring(1, 4), 16);
284+
inst = inst.substring(5);
285285
if (!this.patchInstructions[at]) this.patchInstructions[at] = [];
286286
this.patchInstructions[at].push(inst);
287287
} else {

0 commit comments

Comments
 (0)