Commit 3f3dc7b 1 parent 91cd9ce commit 3f3dc7b Copy full SHA for 3f3dc7b
File tree 1 file changed +7
-10
lines changed
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -683,25 +683,22 @@ NAN_METHOD(getScreenSize)
683
683
684
684
NAN_METHOD (getXDisplayName)
685
685
{
686
- NanScope ();
687
-
688
686
#if defined(USE_X11)
689
- NanReturnValue (NanNew<String>(getXDisplay ()));
687
+ const char * display = getXDisplay ();
688
+ info.GetReturnValue ().Set (Nan::New<String>(display).ToLocalChecked ());
690
689
#else
691
- NanThrowError (" getXDisplayName is only supported on Linux" );
690
+ Nan::ThrowError (" getXDisplayName is only supported on Linux" );
692
691
#endif
693
692
}
694
693
695
694
NAN_METHOD (setXDisplayName)
696
695
{
697
- NanScope ();
698
-
699
696
#if defined(USE_X11)
700
- NanUtf8String name (args [0 ]);
701
- setXDisplay (*name );
702
- NanReturnValue ( NanNew ( " 1 " ));
697
+ Nan::Utf8String string (info [0 ]);
698
+ setXDisplay (*string );
699
+ info. GetReturnValue (). Set ( Nan::New ( 1 ));
703
700
#else
704
- NanThrowError (" setXDisplayName is only supported on Linux" );
701
+ Nan::ThrowError (" setXDisplayName is only supported on Linux" );
705
702
#endif
706
703
}
707
704
You can’t perform that action at this time.
0 commit comments