Skip to content

Commit 2a4cf9d

Browse files
authored
Merge branch 'develop' into snyk-fix-258d99e1cfea006a8209530d07043852
2 parents 40fe6ae + 0afbf96 commit 2a4cf9d

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

Diff for: src/core/fetch/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function fetchMixin(proto) {
7373
case 'object':
7474
key = Object.keys(notFoundPage)
7575
.sort((a, b) => b.length - a.length)
76-
.find(key => path.match(new RegExp('^' + key)));
76+
.find(k => path.match(new RegExp('^' + k)));
7777

7878
path404 = (key && notFoundPage[key]) || defaultPath;
7979
break;

Diff for: src/core/init/lifecycle.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,22 @@ export function initLifecycle(vm) {
1818
});
1919
}
2020

21-
export function callHook(vm, hook, data, next = noop) {
22-
const queue = vm._hooks[hook];
21+
export function callHook(vm, hookName, data, next = noop) {
22+
const queue = vm._hooks[hookName];
2323

2424
const step = function(index) {
25-
const hook = queue[index];
25+
const hookFn = queue[index];
26+
2627
if (index >= queue.length) {
2728
next(data);
28-
} else if (typeof hook === 'function') {
29-
if (hook.length === 2) {
30-
hook(data, result => {
29+
} else if (typeof hookFn === 'function') {
30+
if (hookFn.length === 2) {
31+
hookFn(data, result => {
3132
data = result;
3233
step(index + 1);
3334
});
3435
} else {
35-
const result = hook(data);
36+
const result = hookFn(data);
3637
data = result === undefined ? data : result;
3738
step(index + 1);
3839
}

Diff for: src/core/render/embed.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function walkFetchEmbed({ embedTokens, compile, fetch }, cb) {
1414
}
1515

1616
while ((token = embedTokens[step++])) {
17+
// eslint-disable-next-line no-shadow
1718
const next = (function(token) {
1819
return text => {
1920
let embedToken;

Diff for: src/core/render/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ export function renderMixin(proto) {
190190
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated);
191191
}
192192

193-
callHook(this, 'afterEach', html, text => renderMain.call(this, text));
193+
callHook(this, 'afterEach', html, hookData =>
194+
renderMain.call(this, hookData)
195+
);
194196
};
195197

196198
if (this.isHTML) {

0 commit comments

Comments
 (0)