|
3 | 3 | // This is only exposed for internal build steps and testing purposes. |
4 | 4 | // We create new copies of the source and the code cache |
5 | 5 | // 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. |
7 | 7 |
|
8 | | -const { |
9 | | - NativeModule |
10 | | -} = require('internal/bootstrap/loaders'); |
| 8 | +const { NativeModule } = require('internal/bootstrap/loaders'); |
11 | 9 | const { hasTracing } = process.binding('config'); |
12 | 10 |
|
13 | 11 | function getCodeCache(id) { |
@@ -26,52 +24,55 @@ const depsModule = Object.keys(NativeModule._source).filter( |
26 | 24 | ); |
27 | 25 |
|
28 | 26 | // Modules with source code compiled in js2c that |
29 | | -// cannot be compiled with the code cache |
| 27 | +// cannot be compiled with the code cache. |
30 | 28 | const cannotUseCache = [ |
31 | 29 | 'config', |
32 | | - 'sys', // deprecated |
| 30 | + 'sys', // Deprecated. |
33 | 31 | 'internal/v8_prof_polyfill', |
34 | 32 | 'internal/v8_prof_processor', |
35 | 33 |
|
36 | 34 | 'internal/per_context', |
37 | 35 |
|
38 | 36 | 'internal/test/binding', |
39 | 37 | // 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. |
42 | 39 | 'internal/bootstrap/loaders', |
43 | 40 | 'internal/bootstrap/node' |
44 | 41 | ].concat(depsModule); |
45 | 42 |
|
46 | 43 | // Skip modules that cannot be required when they are not |
47 | 44 | // built into the binary. |
48 | 45 | 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 | + ); |
51 | 50 | } |
52 | 51 | if (!hasTracing) { |
53 | 52 | cannotUseCache.push('trace_events'); |
54 | 53 | } |
55 | 54 | 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 | + ); |
75 | 76 | } |
76 | 77 |
|
77 | 78 | module.exports = { |
|