Operations can now set options from within the worker

This commit is contained in:
n1474335 2017-09-20 00:37:57 +01:00
parent 13f07abb8a
commit f6b52b7c82
10 changed files with 81 additions and 38 deletions

View file

@ -119,11 +119,11 @@ const ByteRepr = {
else if (ordinal < 4294967296) padding = 8;
else padding = 2;
if (padding > 2 && app) app.options.attemptHighlight = false;
if (padding > 2 && ENVIRONMENT_IS_WORKER()) self.setOption("attemptHighlight", false);
output += Utils.hex(ordinal, padding) + delim;
} else {
if (app) app.options.attemptHighlight = false;
if (ENVIRONMENT_IS_WORKER()) self.setOption("attemptHighlight", false);
output += ordinal.toString(base) + delim;
}
}
@ -149,9 +149,7 @@ const ByteRepr = {
throw "Error: Base argument must be between 2 and 36";
}
if (base !== 16 && app) {
app.options.attemptHighlight = false;
}
if (base !== 16 && ENVIRONMENT_IS_WORKER()) self.setOption("attemptHighlight", false);
// Split into groups of 2 if the whole string is concatenated and
// too long to be a single character