aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/base-compiler.ts2
-rw-r--r--lib/buildenvsetup/ceconan-rust.ts2
-rw-r--r--lib/compiler-arguments.ts6
-rw-r--r--lib/compilers/argument-parsers.ts6
-rw-r--r--lib/compilers/clang.ts2
-rw-r--r--lib/compilers/java.ts2
-rw-r--r--lib/compilers/llvm-mos.ts4
-rw-r--r--lib/compilers/pascal.ts18
-rw-r--r--lib/compilers/ptxas.ts4
-rw-r--r--lib/compilers/wine-vc.ts2
-rw-r--r--lib/demangler/pascal.ts20
-rw-r--r--lib/demangler/prefix-tree.ts4
-rw-r--r--lib/llvm-ir.ts2
-rw-r--r--lib/parsers/asm-parser-hexagon.ts2
-rw-r--r--lib/parsers/asm-parser.ts2
-rw-r--r--lib/storage/base.ts2
-rw-r--r--lib/utils.ts6
-rw-r--r--static/ansi-to-html.ts8
-rw-r--r--static/sharing.ts2
19 files changed, 49 insertions, 47 deletions
diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts
index f41bae8c0..91ac849d1 100644
--- a/lib/base-compiler.ts
+++ b/lib/base-compiler.ts
@@ -2211,7 +2211,7 @@ export class BaseCompiler implements ICompiler {
const foundlibOptions: string[] = [];
_.each(libsAndOptions.options, option => {
if (option.indexOf(linkFlag) === 0) {
- const libVersion = this.findAutodetectStaticLibLink(option.substr(linkFlag.length).trim());
+ const libVersion = this.findAutodetectStaticLibLink(option.substring(linkFlag.length).trim());
if (libVersion) {
foundlibOptions.push(option);
detectedLibs.push(libVersion);
diff --git a/lib/buildenvsetup/ceconan-rust.ts b/lib/buildenvsetup/ceconan-rust.ts
index b4a200ff9..a1f3519b9 100644
--- a/lib/buildenvsetup/ceconan-rust.ts
+++ b/lib/buildenvsetup/ceconan-rust.ts
@@ -75,7 +75,7 @@ export class BuildEnvSetupCeConanRustDirect extends BuildEnvSetupCeConanDirect {
});
if (target) {
- const triple = target.substr(target.indexOf('=') + 1);
+ const triple = target.substring(target.indexOf('=') + 1);
return this.getArchFromTriple(triple);
} else {
const idx = key.options.indexOf('--target');
diff --git a/lib/compiler-arguments.ts b/lib/compiler-arguments.ts
index a471a6b22..230dabbbf 100644
--- a/lib/compiler-arguments.ts
+++ b/lib/compiler-arguments.ts
@@ -164,7 +164,7 @@ export class CompilerArguments implements ICompilerArguments {
if (documentedOption.includes('=')) {
const idx = documentedOption.indexOf('=');
if (givenOption.indexOf('=') === idx) {
- if (documentedOption.substr(0, idx) === givenOption.substr(0, idx)) {
+ if (documentedOption.substring(0, idx) === givenOption.substring(0, idx)) {
return documentedOption;
}
}
@@ -173,7 +173,7 @@ export class CompilerArguments implements ICompilerArguments {
if (documentedOption.includes(':')) {
const idx = documentedOption.indexOf(':');
if (givenOption.indexOf(':') === idx) {
- if (documentedOption.substr(0, idx) === givenOption.substr(0, idx)) {
+ if (documentedOption.substring(0, idx) === givenOption.substring(0, idx)) {
return documentedOption;
}
}
@@ -181,7 +181,7 @@ export class CompilerArguments implements ICompilerArguments {
if (documentedOption.includes('[')) {
const idx = documentedOption.indexOf('[') - 1;
- if (documentedOption.indexOf(givenOption.substr(0, idx)) === 0) {
+ if (documentedOption.indexOf(givenOption.substring(0, idx)) === 0) {
return documentedOption;
}
}
diff --git a/lib/compilers/argument-parsers.ts b/lib/compilers/argument-parsers.ts
index 4d9fe5af8..1556ad09f 100644
--- a/lib/compilers/argument-parsers.ts
+++ b/lib/compilers/argument-parsers.ts
@@ -711,8 +711,8 @@ export class VCParser extends BaseParser {
let col1;
let col2;
if (line.length > 39 && line[40] === '/') {
- col1 = line.substr(0, 39);
- col2 = line.substr(40);
+ col1 = line.substring(0, 39);
+ col2 = line.substring(40);
} else {
col1 = line;
col2 = '';
@@ -923,7 +923,7 @@ export class TableGenParser extends BaseParser {
}
actions.push({
- name: action_match[1].substr(2) + ': ' + action_match[2],
+ name: action_match[1].substring(2) + ': ' + action_match[2],
value: action_match[1],
});
}
diff --git a/lib/compilers/clang.ts b/lib/compilers/clang.ts
index 3ebad0961..dab518bc7 100644
--- a/lib/compilers/clang.ts
+++ b/lib/compilers/clang.ts
@@ -216,7 +216,7 @@ export class ClangCompiler extends BaseCompiler {
if (startOrEnd === '__START__') {
prevStart = match.index + full.length + 1;
} else {
- devices[triple] = assembly.substr(prevStart, match.index - prevStart);
+ devices[triple] = assembly.substring(prevStart, match.index);
}
}
return devices;
diff --git a/lib/compilers/java.ts b/lib/compilers/java.ts
index 8fea06be2..2555507f9 100644
--- a/lib/compilers/java.ts
+++ b/lib/compilers/java.ts
@@ -382,7 +382,7 @@ export class JavaCompiler extends BaseCompiler implements SimpleOutputFilenameCo
if (lastIndex !== -1) {
// Get "interesting" text after the LineNumbers table (header of next method/tail of file)
// trimRight() because of trailing \r on Windows
- textsBeforeMethod.push(codeAndLineNumberTable.substr(lastIndex).trimEnd());
+ textsBeforeMethod.push(codeAndLineNumberTable.substring(lastIndex).trimEnd());
}
if (currentSourceLine !== -1) {
diff --git a/lib/compilers/llvm-mos.ts b/lib/compilers/llvm-mos.ts
index 9ff68a784..026a0fe45 100644
--- a/lib/compilers/llvm-mos.ts
+++ b/lib/compilers/llvm-mos.ts
@@ -84,7 +84,7 @@ export class LLVMMOSCompiler extends ClangCompiler {
if (this.compiler.exe.includes('nes')) {
let nesFile = outputFilename;
if (outputFilename.endsWith('.elf')) {
- nesFile = outputFilename.substr(0, outputFilename.length - 4);
+ nesFile = outputFilename.substring(0, outputFilename.length - 4);
}
if (await utils.fileExists(nesFile)) {
@@ -93,7 +93,7 @@ export class LLVMMOSCompiler extends ClangCompiler {
} else if (this.compiler.exe.includes('c64')) {
let prgFile = outputFilename;
if (outputFilename.endsWith('.elf')) {
- prgFile = outputFilename.substr(0, outputFilename.length - 4);
+ prgFile = outputFilename.substring(0, outputFilename.length - 4);
}
if (await utils.fileExists(prgFile)) {
diff --git a/lib/compilers/pascal.ts b/lib/compilers/pascal.ts
index c91ba6a8b..71fe03a01 100644
--- a/lib/compilers/pascal.ts
+++ b/lib/compilers/pascal.ts
@@ -132,10 +132,12 @@ export class FPCCompiler extends BaseCompiler {
if (relevantAsmStartsAt !== -1) {
const lastLinefeedBeforeStart = input.lastIndexOf('\n', relevantAsmStartsAt);
if (lastLinefeedBeforeStart === -1) {
- input = input.substr(0, input.indexOf('00000000004')) + '\n' + input.substr(relevantAsmStartsAt);
+ input = input.substring(0, input.indexOf('00000000004')) + '\n' + input.substring(relevantAsmStartsAt);
} else {
input =
- input.substr(0, input.indexOf('00000000004')) + '\n' + input.substr(lastLinefeedBeforeStart + 1);
+ input.substring(0, input.indexOf('00000000004')) +
+ '\n' +
+ input.substring(lastLinefeedBeforeStart + 1);
}
}
return input;
@@ -229,14 +231,14 @@ export class FPCCompiler extends BaseCompiler {
getExtraAsmHint(asm: string, currentFileId: number) {
if (asm.startsWith('# [')) {
const bracketEndPos = asm.indexOf(']', 3);
- let valueInBrackets = asm.substr(3, bracketEndPos - 3);
+ let valueInBrackets = asm.substring(3, bracketEndPos);
const colonPos = valueInBrackets.indexOf(':');
if (colonPos !== -1) {
- valueInBrackets = valueInBrackets.substr(0, colonPos - 1);
+ valueInBrackets = valueInBrackets.substring(0, colonPos - 1);
}
if (valueInBrackets.startsWith('/')) {
- valueInBrackets = valueInBrackets.substr(1);
+ valueInBrackets = valueInBrackets.substring(1);
}
if (Number.isNaN(Number(valueInBrackets))) {
@@ -254,14 +256,14 @@ export class FPCCompiler extends BaseCompiler {
tryGetFilenumber(asm: string, files: Record<string, number>) {
if (asm.startsWith('# [')) {
const bracketEndPos = asm.indexOf(']', 3);
- let valueInBrackets = asm.substr(3, bracketEndPos - 3);
+ let valueInBrackets = asm.substring(3, bracketEndPos);
const colonPos = valueInBrackets.indexOf(':');
if (colonPos !== -1) {
- valueInBrackets = valueInBrackets.substr(0, colonPos - 1);
+ valueInBrackets = valueInBrackets.substring(0, colonPos - 1);
}
if (valueInBrackets.startsWith('/')) {
- valueInBrackets = valueInBrackets.substr(1);
+ valueInBrackets = valueInBrackets.substring(1);
}
if (Number.isNaN(Number(valueInBrackets))) {
diff --git a/lib/compilers/ptxas.ts b/lib/compilers/ptxas.ts
index 40157ded0..9302dccd6 100644
--- a/lib/compilers/ptxas.ts
+++ b/lib/compilers/ptxas.ts
@@ -54,8 +54,8 @@ export class PtxAssembler extends BaseCompiler {
line = line.split(inputFilename).join('<source>');
if (inputFilename.indexOf('./') === 0) {
- line = line.split('/home/ubuntu/' + inputFilename.substr(2)).join('<source>');
- line = line.split('/home/ce/' + inputFilename.substr(2)).join('<source>');
+ line = line.split('/home/ubuntu/' + inputFilename.substring(2)).join('<source>');
+ line = line.split('/home/ce/' + inputFilename.substring(2)).join('<source>');
}
}
if (line !== null) {
diff --git a/lib/compilers/wine-vc.ts b/lib/compilers/wine-vc.ts
index 461085092..db4a3d72f 100644
--- a/lib/compilers/wine-vc.ts
+++ b/lib/compilers/wine-vc.ts
@@ -61,7 +61,7 @@ export class WineVcCompiler extends BaseCompiler {
execOptions.customCwd = path.dirname(inputFilename);
if (inputFilename.startsWith('Z:')) {
- execOptions.customCwd = execOptions.customCwd.substr(2);
+ execOptions.customCwd = execOptions.customCwd.substring(2);
}
return await super.runCompiler(compiler, options, inputFilename, execOptions);
diff --git a/lib/demangler/pascal.ts b/lib/demangler/pascal.ts
index a66e273be..13962c8bd 100644
--- a/lib/demangler/pascal.ts
+++ b/lib/demangler/pascal.ts
@@ -108,7 +108,7 @@ export class PascalDemangler extends BaseDemangler {
if (!text.endsWith(':')) return false;
if (this.shouldIgnoreSymbol(text)) return false;
- text = text.substr(0, text.length - 1);
+ text = text.substring(0, text.length - 1);
for (const k in this.fixedsymbols) {
if (text === k) {
@@ -119,11 +119,11 @@ export class PascalDemangler extends BaseDemangler {
}
if (text.startsWith('U_$OUTPUT_$$_')) {
- const unmangledGlobalVar = text.substr(13).toLowerCase();
+ const unmangledGlobalVar = text.substring(13).toLowerCase();
this.symbolStore.add(text, unmangledGlobalVar);
return unmangledGlobalVar;
} else if (text.startsWith('U_OUTPUT_')) {
- const unmangledGlobalVar = text.substr(9).toLowerCase();
+ const unmangledGlobalVar = text.substring(9).toLowerCase();
this.symbolStore.add(text, unmangledGlobalVar);
return unmangledGlobalVar;
}
@@ -139,15 +139,15 @@ export class PascalDemangler extends BaseDemangler {
idx = text.indexOf('$_$');
if (idx !== -1) {
- unitname = text.substr(0, idx - 1);
- classname = text.substr(idx + 3, text.indexOf('_$_', idx + 2) - idx - 3);
+ unitname = text.substring(0, idx - 1);
+ classname = text.substring(idx + 3, text.indexOf('_$_', idx + 2));
}
let signature = '';
idx = text.indexOf('_$$_');
if (idx !== -1) {
- if (unitname === '') unitname = text.substr(0, idx - 1);
- signature = text.substr(idx + 3);
+ if (unitname === '') unitname = text.substring(0, idx - 1);
+ signature = text.substring(idx + 3);
}
if (unitname === '') {
@@ -157,10 +157,10 @@ export class PascalDemangler extends BaseDemangler {
idx = text.indexOf('_$__');
if (idx === -1) {
- signature = text.substr(6);
+ signature = text.substring(6);
} else {
- classname = text.substr(7, idx - 7);
- signature = text.substr(idx + 3);
+ classname = text.substring(7, idx);
+ signature = text.substring(idx + 3);
}
}
}
diff --git a/lib/demangler/prefix-tree.ts b/lib/demangler/prefix-tree.ts
index d481a8d0f..6e1ad28d7 100644
--- a/lib/demangler/prefix-tree.ts
+++ b/lib/demangler/prefix-tree.ts
@@ -68,7 +68,7 @@ export class PrefixTree {
assert(character !== undefined, 'Undefined code point encountered in PrefixTree');
node = node[character];
if (!node) break;
- if (node.result) match = [needle.substr(0, i + 1), node.result];
+ if (node.result) match = [needle.substring(0, i + 1), node.result];
}
return match;
}
@@ -93,7 +93,7 @@ export class PrefixTree {
// Use a binary search to find the replacements (allowing a prefix match). If we couldn't find a match, skip
// on, else use the replacement, and skip by that amount.
while (index < line.length) {
- const lineBit = line.substr(index);
+ const lineBit = line.substring(index);
const [oldValue, newValue] = this.findLongestMatch(lineBit);
if (oldValue) {
// We found a replacement.
diff --git a/lib/llvm-ir.ts b/lib/llvm-ir.ts
index 0a15ff4c7..87560de0c 100644
--- a/lib/llvm-ir.ts
+++ b/lib/llvm-ir.ts
@@ -147,7 +147,7 @@ export class LlvmIrParser {
metaNode[key] = keyValuePair[2];
// Remove "" from string
if (metaNode[key][0] === '"') {
- metaNode[key] = metaNode[key].substr(1, metaNode[key].length - 2);
+ metaNode[key] = metaNode[key].substring(1, metaNode[key].length - 1);
}
}
diff --git a/lib/parsers/asm-parser-hexagon.ts b/lib/parsers/asm-parser-hexagon.ts
index eabeff386..8369e5559 100644
--- a/lib/parsers/asm-parser-hexagon.ts
+++ b/lib/parsers/asm-parser-hexagon.ts
@@ -50,7 +50,7 @@ export class HexagonAsmParser extends AsmParser {
// Remove any leading label definition...
const match = line.match(this.labelDef);
if (match) {
- line = line.substr(match[0].length);
+ line = line.substring(match[0].length);
}
// Strip any comments
line = line.split(this.commentRe, 1)[0];
diff --git a/lib/parsers/asm-parser.ts b/lib/parsers/asm-parser.ts
index a3081315e..9afabd1ff 100644
--- a/lib/parsers/asm-parser.ts
+++ b/lib/parsers/asm-parser.ts
@@ -173,7 +173,7 @@ export class AsmParser extends AsmRegex implements IAsmParser {
// Remove any leading label definition...
const match = line.match(this.labelDef);
if (match) {
- line = line.substr(match[0].length);
+ line = line.substring(match[0].length);
}
// Strip any comments
line = line.split(this.commentRe, 1)[0];
diff --git a/lib/storage/base.ts b/lib/storage/base.ts
index 520fd7f53..26c28c997 100644
--- a/lib/storage/base.ts
+++ b/lib/storage/base.ts
@@ -68,7 +68,7 @@ export abstract class StorageBase {
// Keep rehashing until a usable text is found
let configHash = StorageBase.getRawConfigHash(config);
let tries = 1;
- while (!StorageBase.isCleanText(configHash.substr(0, USABLE_HASH_CHECK_LENGTH))) {
+ while (!StorageBase.isCleanText(configHash.substring(0, USABLE_HASH_CHECK_LENGTH))) {
// Shake up the hash a bit by adding, or incrementing a nonce value.
config.nonce = tries;
logger.info(`Unusable text found in full hash ${configHash} - Trying again (${tries})`);
diff --git a/lib/utils.ts b/lib/utils.ts
index d1129f3e9..86532845c 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -58,7 +58,7 @@ export function expandTabs(line: string): string {
const total = offset + extraChars;
const spacesNeeded = (total + 8) & 7;
extraChars += spacesNeeded - 1;
- return ' '.substr(spacesNeeded);
+ return ' '.substring(spacesNeeded);
});
}
@@ -266,7 +266,7 @@ export function padRight(name: string, len: number): string {
export function trimRight(name: string): string {
let l = name.length;
while (l > 0 && name[l - 1] === ' ') l -= 1;
- return name.substr(0, l);
+ return name.substring(0, l);
}
/***
@@ -407,7 +407,7 @@ export function replaceAll(line: string, oldValue: string, newValue: string): st
for (;;) {
const index = line.indexOf(oldValue, startPoint);
if (index === -1) break;
- line = line.substr(0, index) + newValue + line.substr(index + oldValue.length);
+ line = line.substring(0, index) + newValue + line.substring(index + oldValue.length);
startPoint = index + newValue.length;
}
return line;
diff --git a/static/ansi-to-html.ts b/static/ansi-to-html.ts
index 31d1e811a..c3e2b645d 100644
--- a/static/ansi-to-html.ts
+++ b/static/ansi-to-html.ts
@@ -138,12 +138,12 @@ function generateOutput(stack: string[], token: string, data: string | number, o
function handleRgb(stack: string[], data: string, options: AnsiToHtmlOptions) {
data = data.substring(2).slice(0, -1);
- const operation = +data.substr(0, 2);
+ const operation = +data.substring(0, 2);
const color = data.substring(5).split(';');
const rgb = color
.map(value => {
- return ('0' + Number(value).toString(16)).substr(-2);
+ return ('0' + Number(value).toString(16)).slice(-2);
})
.join('');
@@ -152,8 +152,8 @@ function handleRgb(stack: string[], data: string, options: AnsiToHtmlOptions) {
function handleXterm256(stack: string[], data: string, options: AnsiToHtmlOptions): string {
data = data.substring(2).slice(0, -1);
- const operation = +data.substr(0, 2);
- const color = +data.substr(5);
+ const operation = +data.substring(0, 2);
+ const color = +data.substring(5);
if (operation === 38) {
return pushForegroundColor(stack, options.colors[color]);
} else {
diff --git a/static/sharing.ts b/static/sharing.ts
index 4cded4ccc..a79d654ba 100644
--- a/static/sharing.ts
+++ b/static/sharing.ts
@@ -139,7 +139,7 @@ export class Sharing {
const config = Sharing.filterComponentState(this.layout.toConfig());
this.ensureUrlIsNotOutdated(config);
if (options.embedded) {
- const strippedToLast = window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/') + 1);
+ const strippedToLast = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1);
$('a.link').prop('href', strippedToLast + '#' + url.serialiseState(config));
}
}