@@ -1041,7 +1041,7 @@ void DefineCryptoConstants(Local<Object> target) {
1041
1041
#endif
1042
1042
}
1043
1043
1044
- void DefineSystemConstants (Local<Object> target) {
1044
+ void DefineFsConstants (Local<Object> target) {
1045
1045
NODE_DEFINE_CONSTANT (target, UV_FS_SYMLINK_DIR);
1046
1046
NODE_DEFINE_CONSTANT (target, UV_FS_SYMLINK_JUNCTION);
1047
1047
// file access modes
@@ -1059,10 +1059,6 @@ void DefineSystemConstants(Local<Object> target) {
1059
1059
NODE_DEFINE_CONSTANT (target, UV_DIRENT_CHAR);
1060
1060
NODE_DEFINE_CONSTANT (target, UV_DIRENT_BLOCK);
1061
1061
1062
- // Define module specific constants
1063
- NODE_DEFINE_CONSTANT (target, EXTENSIONLESS_FORMAT_JAVASCRIPT);
1064
- NODE_DEFINE_CONSTANT (target, EXTENSIONLESS_FORMAT_WASM);
1065
-
1066
1062
NODE_DEFINE_CONSTANT (target, S_IFMT);
1067
1063
NODE_DEFINE_CONSTANT (target, S_IFREG);
1068
1064
NODE_DEFINE_CONSTANT (target, S_IFDIR);
@@ -1250,6 +1246,12 @@ void DefineDLOpenConstants(Local<Object> target) {
1250
1246
#endif
1251
1247
}
1252
1248
1249
+ void DefineInternalConstants (Local<Object> target) {
1250
+ // Define module specific constants
1251
+ NODE_DEFINE_CONSTANT (target, EXTENSIONLESS_FORMAT_JAVASCRIPT);
1252
+ NODE_DEFINE_CONSTANT (target, EXTENSIONLESS_FORMAT_WASM);
1253
+ }
1254
+
1253
1255
void DefineTraceConstants (Local<Object> target) {
1254
1256
NODE_DEFINE_CONSTANT (target, TRACE_EVENT_PHASE_BEGIN);
1255
1257
NODE_DEFINE_CONSTANT (target, TRACE_EVENT_PHASE_END);
@@ -1307,16 +1309,19 @@ void CreatePerContextProperties(Local<Object> target,
1307
1309
Object::New (isolate, Null (isolate), nullptr , nullptr , 0 );
1308
1310
Local<Object> trace_constants =
1309
1311
Object::New (isolate, Null (isolate), nullptr , nullptr , 0 );
1312
+ Local<Object> internal_constants =
1313
+ Object::New (isolate, Null (isolate), nullptr , nullptr , 0 );
1310
1314
1311
1315
DefineErrnoConstants (err_constants);
1312
1316
DefineWindowsErrorConstants (err_constants);
1313
1317
DefineSignalConstants (sig_constants);
1314
1318
DefinePriorityConstants (priority_constants);
1315
- DefineSystemConstants (fs_constants);
1319
+ DefineFsConstants (fs_constants);
1316
1320
DefineCryptoConstants (crypto_constants);
1317
1321
DefineZlibConstants (zlib_constants);
1318
1322
DefineDLOpenConstants (dlopen_constants);
1319
1323
DefineTraceConstants (trace_constants);
1324
+ DefineInternalConstants (internal_constants);
1320
1325
1321
1326
// Define libuv constants.
1322
1327
NODE_DEFINE_CONSTANT (os_constants, UV_UDP_REUSEADDR);
@@ -1362,6 +1367,11 @@ void CreatePerContextProperties(Local<Object> target,
1362
1367
FIXED_ONE_BYTE_STRING (isolate, " trace" ),
1363
1368
trace_constants)
1364
1369
.Check ();
1370
+ target
1371
+ ->Set (env->context (),
1372
+ FIXED_ONE_BYTE_STRING (isolate, " internal" ),
1373
+ internal_constants)
1374
+ .Check ();
1365
1375
}
1366
1376
1367
1377
} // namespace constants
0 commit comments