@@ -758,6 +758,44 @@ void DefineSignalConstants(Local<Object> target) {
758758#endif
759759}
760760
761+ void DefinePriorityConstants (Local<Object> target) {
762+ #ifdef UV_PRIORITY_LOW
763+ # define PRIORITY_LOW UV_PRIORITY_LOW
764+ NODE_DEFINE_CONSTANT (target, PRIORITY_LOW);
765+ # undef PRIORITY_LOW
766+ #endif
767+
768+ #ifdef UV_PRIORITY_BELOW_NORMAL
769+ # define PRIORITY_BELOW_NORMAL UV_PRIORITY_BELOW_NORMAL
770+ NODE_DEFINE_CONSTANT (target, PRIORITY_BELOW_NORMAL);
771+ # undef PRIORITY_BELOW_NORMAL
772+ #endif
773+
774+ #ifdef UV_PRIORITY_NORMAL
775+ # define PRIORITY_NORMAL UV_PRIORITY_NORMAL
776+ NODE_DEFINE_CONSTANT (target, PRIORITY_NORMAL);
777+ # undef PRIORITY_NORMAL
778+ #endif
779+
780+ #ifdef UV_PRIORITY_ABOVE_NORMAL
781+ # define PRIORITY_ABOVE_NORMAL UV_PRIORITY_ABOVE_NORMAL
782+ NODE_DEFINE_CONSTANT (target, PRIORITY_ABOVE_NORMAL);
783+ # undef PRIORITY_ABOVE_NORMAL
784+ #endif
785+
786+ #ifdef UV_PRIORITY_HIGH
787+ # define PRIORITY_HIGH UV_PRIORITY_HIGH
788+ NODE_DEFINE_CONSTANT (target, PRIORITY_HIGH);
789+ # undef PRIORITY_HIGH
790+ #endif
791+
792+ #ifdef UV_PRIORITY_HIGHEST
793+ # define PRIORITY_HIGHEST UV_PRIORITY_HIGHEST
794+ NODE_DEFINE_CONSTANT (target, PRIORITY_HIGHEST);
795+ # undef PRIORITY_HIGHEST
796+ #endif
797+ }
798+
761799void DefineOpenSSLConstants (Local<Object> target) {
762800#ifdef OPENSSL_VERSION_NUMBER
763801 NODE_DEFINE_CONSTANT (target, OPENSSL_VERSION_NUMBER);
@@ -1338,6 +1376,10 @@ void DefineConstants(v8::Isolate* isolate, Local<Object> target) {
13381376 CHECK (sig_constants->SetPrototype (env->context (),
13391377 Null (env->isolate ())).FromJust ());
13401378
1379+ Local<Object> priority_constants = Object::New (isolate);
1380+ CHECK (priority_constants->SetPrototype (env->context (),
1381+ Null (env->isolate ())).FromJust ());
1382+
13411383 Local<Object> fs_constants = Object::New (isolate);
13421384 CHECK (fs_constants->SetPrototype (env->context (),
13431385 Null (env->isolate ())).FromJust ());
@@ -1361,6 +1403,7 @@ void DefineConstants(v8::Isolate* isolate, Local<Object> target) {
13611403 DefineErrnoConstants (err_constants);
13621404 DefineWindowsErrorConstants (err_constants);
13631405 DefineSignalConstants (sig_constants);
1406+ DefinePriorityConstants (priority_constants);
13641407 DefineSystemConstants (fs_constants);
13651408 DefineOpenSSLConstants (crypto_constants);
13661409 DefineCryptoConstants (crypto_constants);
@@ -1374,6 +1417,7 @@ void DefineConstants(v8::Isolate* isolate, Local<Object> target) {
13741417 os_constants->Set (OneByteString (isolate, " dlopen" ), dlopen_constants);
13751418 os_constants->Set (OneByteString (isolate, " errno" ), err_constants);
13761419 os_constants->Set (OneByteString (isolate, " signals" ), sig_constants);
1420+ os_constants->Set (OneByteString (isolate, " priority" ), priority_constants);
13771421 target->Set (OneByteString (isolate, " os" ), os_constants);
13781422 target->Set (OneByteString (isolate, " fs" ), fs_constants);
13791423 target->Set (OneByteString (isolate, " crypto" ), crypto_constants);
0 commit comments