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' ) ;
11- const {
12- getSource,
13- compileCodeCache
14- } = internalBinding ( 'native_module' ) ;
8+ const { NativeModule } = require ( 'internal/bootstrap/loaders' ) ;
9+ const { getSource, compileCodeCache } = internalBinding ( 'native_module' ) ;
1510const { hasTracing } = process . binding ( 'config' ) ;
1611
1712const source = getSource ( ) ;
@@ -20,52 +15,55 @@ const depsModule = Object.keys(source).filter(
2015) ;
2116
2217// Modules with source code compiled in js2c that
23- // cannot be compiled with the code cache
18+ // cannot be compiled with the code cache.
2419const cannotUseCache = [
2520 'config' ,
26- 'sys' , // deprecated
21+ 'sys' , // Deprecated.
2722 'internal/v8_prof_polyfill' ,
2823 'internal/v8_prof_processor' ,
2924
3025 'internal/per_context' ,
3126
3227 'internal/test/binding' ,
3328 // 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.
3630 'internal/bootstrap/loaders' ,
3731 'internal/bootstrap/node'
3832] . concat ( depsModule ) ;
3933
4034// Skip modules that cannot be required when they are not
4135// built into the binary.
4236if ( 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+ ) ;
4541}
4642if ( ! hasTracing ) {
4743 cannotUseCache . push ( 'trace_events' ) ;
4844}
4945if ( ! 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+ ) ;
6967}
7068
7169module . exports = {
0 commit comments