Skip to content

Commit 519e119

Browse files
committed
refactor(prelude): micro-optimisations
- coverted `const` to `var` to reduce transformation time - change AssignmentExpression to UpdateExpression (less AST nodes)
1 parent 254309d commit 519e119

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/templates/.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"rules": {
1010
"no-unused-vars": "off",
11-
"no-var": "off"
11+
"no-var": "off",
12+
"no-plusplus": "off"
1213
}
1314
}

src/templates/prelude.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const VARIABLE = (function (context) {
2-
const locations = JSON.parse(LOCATIONS);
1+
var VARIABLE = (function (context) {
2+
var locations = JSON.parse(LOCATIONS);
33
context[NAMESPACE] = context[NAMESPACE] || {};
44
context[NAMESPACE][FILEPATH] = locations;
55
return function (id, value) {
6-
locations[id][0] += 1;
6+
locations[id][0]++;
77
return value;
88
};
99
})(

0 commit comments

Comments
 (0)