Skip to content

Commit 9daf175

Browse files
vsemozhetbytBethGriggs
authored andcommitted
lib: fix nits in lib/internal/bootstrap/cache.js
* Unwrap short lines. * Unify comments. * Decrease function calls. PR-URL: #24581 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 372073e commit 9daf175

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

lib/internal/bootstrap/cache.js

+30-29
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
// This is only exposed for internal build steps and testing purposes.
44
// We create new copies of the source and the code cache
55
// so the resources eventually used to compile builtin modules
6-
// cannot be tampered with even with --expose-internals
6+
// cannot be tampered with even with --expose-internals.
77

8-
const {
9-
NativeModule
10-
} = require('internal/bootstrap/loaders');
8+
const { NativeModule } = require('internal/bootstrap/loaders');
119
const { hasTracing } = process.binding('config');
1210

1311
function getCodeCache(id) {
@@ -26,52 +24,55 @@ const depsModule = Object.keys(NativeModule._source).filter(
2624
);
2725

2826
// Modules with source code compiled in js2c that
29-
// cannot be compiled with the code cache
27+
// cannot be compiled with the code cache.
3028
const cannotUseCache = [
3129
'config',
32-
'sys', // deprecated
30+
'sys', // Deprecated.
3331
'internal/v8_prof_polyfill',
3432
'internal/v8_prof_processor',
3533

3634
'internal/per_context',
3735

3836
'internal/test/binding',
3937
// TODO(joyeecheung): update the C++ side so that
40-
// the code cache is also used when compiling these
41-
// two files.
38+
// the code cache is also used when compiling these two files.
4239
'internal/bootstrap/loaders',
4340
'internal/bootstrap/node'
4441
].concat(depsModule);
4542

4643
// Skip modules that cannot be required when they are not
4744
// built into the binary.
4845
if (process.config.variables.v8_enable_inspector !== 1) {
49-
cannotUseCache.push('inspector');
50-
cannotUseCache.push('internal/util/inspector');
46+
cannotUseCache.push(
47+
'inspector',
48+
'internal/util/inspector',
49+
);
5150
}
5251
if (!hasTracing) {
5352
cannotUseCache.push('trace_events');
5453
}
5554
if (!process.versions.openssl) {
56-
cannotUseCache.push('crypto');
57-
cannotUseCache.push('https');
58-
cannotUseCache.push('http2');
59-
cannotUseCache.push('tls');
60-
cannotUseCache.push('_tls_common');
61-
cannotUseCache.push('_tls_wrap');
62-
cannotUseCache.push('internal/crypto/certificate');
63-
cannotUseCache.push('internal/crypto/cipher');
64-
cannotUseCache.push('internal/crypto/diffiehellman');
65-
cannotUseCache.push('internal/crypto/hash');
66-
cannotUseCache.push('internal/crypto/keygen');
67-
cannotUseCache.push('internal/crypto/pbkdf2');
68-
cannotUseCache.push('internal/crypto/random');
69-
cannotUseCache.push('internal/crypto/scrypt');
70-
cannotUseCache.push('internal/crypto/sig');
71-
cannotUseCache.push('internal/crypto/util');
72-
cannotUseCache.push('internal/http2/core');
73-
cannotUseCache.push('internal/http2/compat');
74-
cannotUseCache.push('internal/streams/lazy_transform');
55+
cannotUseCache.push(
56+
'crypto',
57+
'https',
58+
'http2',
59+
'tls',
60+
'_tls_common',
61+
'_tls_wrap',
62+
'internal/crypto/certificate',
63+
'internal/crypto/cipher',
64+
'internal/crypto/diffiehellman',
65+
'internal/crypto/hash',
66+
'internal/crypto/keygen',
67+
'internal/crypto/pbkdf2',
68+
'internal/crypto/random',
69+
'internal/crypto/scrypt',
70+
'internal/crypto/sig',
71+
'internal/crypto/util',
72+
'internal/http2/core',
73+
'internal/http2/compat',
74+
'internal/streams/lazy_transform',
75+
);
7576
}
7677

7778
module.exports = {

0 commit comments

Comments
 (0)