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' ) ;
11
- const {
12
- getSource,
13
- compileCodeCache
14
- } = internalBinding ( 'native_module' ) ;
8
+ const { NativeModule } = require ( 'internal/bootstrap/loaders' ) ;
9
+ const { getSource, compileCodeCache } = internalBinding ( 'native_module' ) ;
15
10
const { hasTracing } = process . binding ( 'config' ) ;
16
11
17
12
const source = getSource ( ) ;
@@ -20,52 +15,55 @@ const depsModule = Object.keys(source).filter(
20
15
) ;
21
16
22
17
// Modules with source code compiled in js2c that
23
- // cannot be compiled with the code cache
18
+ // cannot be compiled with the code cache.
24
19
const cannotUseCache = [
25
20
'config' ,
26
- 'sys' , // deprecated
21
+ 'sys' , // Deprecated.
27
22
'internal/v8_prof_polyfill' ,
28
23
'internal/v8_prof_processor' ,
29
24
30
25
'internal/per_context' ,
31
26
32
27
'internal/test/binding' ,
33
28
// TODO(joyeecheung): update the C++ side so that
34
- // the code cache is also used when compiling these
35
- // two files.
29
+ // the code cache is also used when compiling these two files.
36
30
'internal/bootstrap/loaders' ,
37
31
'internal/bootstrap/node'
38
32
] . concat ( depsModule ) ;
39
33
40
34
// Skip modules that cannot be required when they are not
41
35
// built into the binary.
42
36
if ( process . config . variables . v8_enable_inspector !== 1 ) {
43
- cannotUseCache . push ( 'inspector' ) ;
44
- cannotUseCache . push ( 'internal/util/inspector' ) ;
37
+ cannotUseCache . push (
38
+ 'inspector' ,
39
+ 'internal/util/inspector' ,
40
+ ) ;
45
41
}
46
42
if ( ! hasTracing ) {
47
43
cannotUseCache . push ( 'trace_events' ) ;
48
44
}
49
45
if ( ! process . versions . openssl ) {
50
- cannotUseCache . push ( 'crypto' ) ;
51
- cannotUseCache . push ( 'https' ) ;
52
- cannotUseCache . push ( 'http2' ) ;
53
- cannotUseCache . push ( 'tls' ) ;
54
- cannotUseCache . push ( '_tls_common' ) ;
55
- cannotUseCache . push ( '_tls_wrap' ) ;
56
- cannotUseCache . push ( 'internal/crypto/certificate' ) ;
57
- cannotUseCache . push ( 'internal/crypto/cipher' ) ;
58
- cannotUseCache . push ( 'internal/crypto/diffiehellman' ) ;
59
- cannotUseCache . push ( 'internal/crypto/hash' ) ;
60
- cannotUseCache . push ( 'internal/crypto/keygen' ) ;
61
- cannotUseCache . push ( 'internal/crypto/pbkdf2' ) ;
62
- cannotUseCache . push ( 'internal/crypto/random' ) ;
63
- cannotUseCache . push ( 'internal/crypto/scrypt' ) ;
64
- cannotUseCache . push ( 'internal/crypto/sig' ) ;
65
- cannotUseCache . push ( 'internal/crypto/util' ) ;
66
- cannotUseCache . push ( 'internal/http2/core' ) ;
67
- cannotUseCache . push ( 'internal/http2/compat' ) ;
68
- cannotUseCache . push ( 'internal/streams/lazy_transform' ) ;
46
+ cannotUseCache . push (
47
+ 'crypto' ,
48
+ 'https' ,
49
+ 'http2' ,
50
+ 'tls' ,
51
+ '_tls_common' ,
52
+ '_tls_wrap' ,
53
+ 'internal/crypto/certificate' ,
54
+ 'internal/crypto/cipher' ,
55
+ 'internal/crypto/diffiehellman' ,
56
+ 'internal/crypto/hash' ,
57
+ 'internal/crypto/keygen' ,
58
+ 'internal/crypto/pbkdf2' ,
59
+ 'internal/crypto/random' ,
60
+ 'internal/crypto/scrypt' ,
61
+ 'internal/crypto/sig' ,
62
+ 'internal/crypto/util' ,
63
+ 'internal/http2/core' ,
64
+ 'internal/http2/compat' ,
65
+ 'internal/streams/lazy_transform' ,
66
+ ) ;
69
67
}
70
68
71
69
module . exports = {
0 commit comments