mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 01:57:29 +00:00
Prefer const in modern
This commit is contained in:
parent
5e048bc4f0
commit
cc0aa9682f
5 changed files with 8 additions and 8 deletions
|
|
@ -2,7 +2,6 @@
|
|||
"rules": {
|
||||
// TODO: Turn these all back on
|
||||
"camelcase": "off",
|
||||
"prefer-const": "off",
|
||||
"no-shadow": "off",
|
||||
"no-nested-ternary": "off",
|
||||
"no-undef": "off",
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ const parsers = {
|
|||
sendparams: noop,
|
||||
elements: (node, parent) => new JsElements(node, parent),
|
||||
bitmap: async (node, parent, zip) => {
|
||||
let { file, gammagroup, h, id, w, x, y } = node.attributes;
|
||||
let { h, w, x, y } = node.attributes;
|
||||
const { file, gammagroup, id } = node.attributes;
|
||||
// TODO: Escape file for regex
|
||||
const img = getCaseInsensitveFile(zip, file);
|
||||
if (img === undefined) {
|
||||
|
|
|
|||
|
|
@ -135,9 +135,9 @@ export function* interpret(start, program, stack = []) {
|
|||
case 24:
|
||||
case 112: {
|
||||
const methodOffset = command.arg;
|
||||
let { name: methodName, typeOffset: classesOffset } = methods[
|
||||
methodOffset
|
||||
];
|
||||
const method = methods[methodOffset];
|
||||
let methodName = method.name;
|
||||
const classesOffset = method.typeOffset;
|
||||
methodName = methodName.toLowerCase();
|
||||
|
||||
const klass = classes[classesOffset];
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const getMakiMethods = obj =>
|
|||
);
|
||||
});
|
||||
|
||||
for (let [key, Klass] of Object.entries(runtime)) {
|
||||
for (const [key, Klass] of Object.entries(runtime)) {
|
||||
const obj = getClass(key);
|
||||
describe(`${obj.name}`, () => {
|
||||
test("implements getclassname()", () => {
|
||||
|
|
@ -30,7 +30,7 @@ for (let [key, Klass] of Object.entries(runtime)) {
|
|||
describe("Maki classes", () => {
|
||||
const runtimeMethods = new Set();
|
||||
const objectMethods = new Set();
|
||||
for (let [key, Klass] of Object.entries(runtime)) {
|
||||
for (const [key, Klass] of Object.entries(runtime)) {
|
||||
const obj = getClass(key);
|
||||
getMakiMethods(Klass.prototype).forEach(methodName => {
|
||||
runtimeMethods.add(`${obj.name}.${methodName}`);
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ function findDirectDescendantById(node, id) {
|
|||
function* iterateLexicalScope(node) {
|
||||
let currentNode = node;
|
||||
while (currentNode.parent) {
|
||||
let { parent } = currentNode;
|
||||
const { parent } = currentNode;
|
||||
const { children } = parent;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue