[lint] fix a few more rules · browserify/pbkdf2@ab04da8
@@ -21,25 +21,6 @@ var toBrowser = {
2121sha512: 'SHA-512'
2222};
2323var checks = [];
24-function checkNative(algo) {
25-if (global.process && !global.process.browser) {
26-return Promise.resolve(false);
27-}
28-if (!subtle || !subtle.importKey || !subtle.deriveBits) {
29-return Promise.resolve(false);
30-}
31-if (checks[algo] !== undefined) {
32-return checks[algo];
33-}
34-ZERO_BUF = ZERO_BUF || Buffer.alloc(8);
35-var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
36-.then(
37-function () { return true; },
38-function () { return false; }
39-);
40-checks[algo] = prom;
41-return prom;
42-}
4324var nextTick;
4425function getNextTick() {
4526if (nextTick) {
@@ -70,6 +51,25 @@ function browserPbkdf2(password, salt, iterations, length, algo) {
7051return Buffer.from(res);
7152});
7253}
54+function checkNative(algo) {
55+if (global.process && !global.process.browser) {
56+return Promise.resolve(false);
57+}
58+if (!subtle || !subtle.importKey || !subtle.deriveBits) {
59+return Promise.resolve(false);
60+}
61+if (checks[algo] !== undefined) {
62+return checks[algo];
63+}
64+ZERO_BUF = ZERO_BUF || Buffer.alloc(8);
65+var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)
66+.then(
67+function () { return true; },
68+function () { return false; }
69+);
70+checks[algo] = prom;
71+return prom;
72+}
73737474function resolvePromise(promise, callback) {
7575promise.then(function (out) {
@@ -97,7 +97,8 @@ module.exports = function (password, salt, iterations, keylen, digest, callback)
9797try {
9898out = sync(password, salt, iterations, keylen, digest);
9999} catch (e) {
100-return callback(e);
100+callback(e);
101+return;
101102}
102103callback(null, out);
103104});