@@ -1040,7 +1040,7 @@ void DefineCryptoConstants(Local<Object> target) {
1040
1040
#endif
1041
1041
}
1042
1042
1043
- void DefineSystemConstants (Local<Object> target) {
1043
+ void DefineFsConstants (Local<Object> target) {
1044
1044
NODE_DEFINE_CONSTANT (target, UV_FS_SYMLINK_DIR);
1045
1045
NODE_DEFINE_CONSTANT (target, UV_FS_SYMLINK_JUNCTION);
1046
1046
// file access modes
@@ -1058,10 +1058,6 @@ void DefineSystemConstants(Local<Object> target) {
1058
1058
NODE_DEFINE_CONSTANT (target, UV_DIRENT_CHAR);
1059
1059
NODE_DEFINE_CONSTANT (target, UV_DIRENT_BLOCK);
1060
1060
1061
- // Define module specific constants
1062
- NODE_DEFINE_CONSTANT (target, EXTENSIONLESS_FORMAT_JAVASCRIPT);
1063
- NODE_DEFINE_CONSTANT (target, EXTENSIONLESS_FORMAT_WASM);
1064
-
1065
1061
NODE_DEFINE_CONSTANT (target, S_IFMT);
1066
1062
NODE_DEFINE_CONSTANT (target, S_IFREG);
1067
1063
NODE_DEFINE_CONSTANT (target, S_IFDIR);
@@ -1249,6 +1245,12 @@ void DefineDLOpenConstants(Local<Object> target) {
1249
1245
#endif
1250
1246
}
1251
1247
1248
+ void DefineInternalConstants (Local<Object> target) {
1249
+ // Define module specific constants
1250
+ NODE_DEFINE_CONSTANT (target, EXTENSIONLESS_FORMAT_JAVASCRIPT);
1251
+ NODE_DEFINE_CONSTANT (target, EXTENSIONLESS_FORMAT_WASM);
1252
+ }
1253
+
1252
1254
void DefineTraceConstants (Local<Object> target) {
1253
1255
NODE_DEFINE_CONSTANT (target, TRACE_EVENT_PHASE_BEGIN);
1254
1256
NODE_DEFINE_CONSTANT (target, TRACE_EVENT_PHASE_END);
@@ -1323,15 +1325,20 @@ void CreatePerContextProperties(Local<Object> target,
1323
1325
CHECK (trace_constants->SetPrototype (env->context (),
1324
1326
Null (env->isolate ())).FromJust ());
1325
1327
1328
+ Local<Object> internal_constants = Object::New (isolate);
1329
+ CHECK (internal_constants->SetPrototype (env->context (),
1330
+ Null (env->isolate ())).FromJust ());
1331
+
1326
1332
DefineErrnoConstants (err_constants);
1327
1333
DefineWindowsErrorConstants (err_constants);
1328
1334
DefineSignalConstants (sig_constants);
1329
1335
DefinePriorityConstants (priority_constants);
1330
- DefineSystemConstants (fs_constants);
1336
+ DefineFsConstants (fs_constants);
1331
1337
DefineCryptoConstants (crypto_constants);
1332
1338
DefineZlibConstants (zlib_constants);
1333
1339
DefineDLOpenConstants (dlopen_constants);
1334
1340
DefineTraceConstants (trace_constants);
1341
+ DefineInternalConstants (internal_constants);
1335
1342
1336
1343
// Define libuv constants.
1337
1344
NODE_DEFINE_CONSTANT (os_constants, UV_UDP_REUSEADDR);
@@ -1377,6 +1384,11 @@ void CreatePerContextProperties(Local<Object> target,
1377
1384
FIXED_ONE_BYTE_STRING (isolate, " trace" ),
1378
1385
trace_constants)
1379
1386
.Check ();
1387
+ target
1388
+ ->Set (env->context (),
1389
+ FIXED_ONE_BYTE_STRING (isolate, " internal" ),
1390
+ internal_constants)
1391
+ .Check ();
1380
1392
}
1381
1393
1382
1394
} // namespace constants
0 commit comments