@@ -172,7 +172,7 @@ protected ActiveScriptJsEngineBase(JsEngineSettings settings, string clsid,
172172 }
173173 finally
174174 {
175- if ( _dispatch == null )
175+ if ( _dispatch is null )
176176 {
177177 Dispose ( ) ;
178178 }
@@ -187,14 +187,14 @@ protected ActiveScriptJsEngineBase(JsEngineSettings settings, string clsid,
187187 /// or <c>0</c> to use the default maximum stack size specified in the header for the executable.</param>
188188 private static void InitScriptDispatcher ( int maxStackSize )
189189 {
190- if ( _dispatcher != null )
190+ if ( _dispatcher is not null )
191191 {
192192 return ;
193193 }
194194
195195 lock ( _dispatcherSynchronizer )
196196 {
197- if ( _dispatcher != null )
197+ if ( _dispatcher is not null )
198198 {
199199 return ;
200200 }
@@ -328,7 +328,7 @@ private ActiveScriptException GetAndResetLastException()
328328 private void ThrowError ( )
329329 {
330330 ActiveScriptException last = GetAndResetLastException ( ) ;
331- if ( last != null )
331+ if ( last is not null )
332332 {
333333 throw last ;
334334 }
@@ -539,7 +539,7 @@ private void InnerEmbedHostItem(string itemName, object value)
539539 }
540540 catch
541541 {
542- if ( oldValue != null )
542+ if ( oldValue is not null )
543543 {
544544 _hostItems [ itemName ] = oldValue ;
545545 }
@@ -607,12 +607,12 @@ private object[] MapToHostType(object[] args)
607607 private static IExpando WrapScriptDispatch ( object dispatch )
608608 {
609609 IExpando wrappedDispatch = null ;
610- if ( dispatch != null && dispatch . GetType ( ) . IsCOMObject )
610+ if ( dispatch is not null && dispatch . GetType ( ) . IsCOMObject )
611611 {
612612 wrappedDispatch = dispatch as IExpando ;
613613 }
614614
615- if ( wrappedDispatch == null )
615+ if ( wrappedDispatch is null )
616616 {
617617 throw new InvalidOperationException (
618618 NetFrameworkStrings . Engine_ActiveScriptDispatcherNotInitialized ) ;
@@ -652,7 +652,7 @@ private JsException WrapActiveScriptException(ActiveScriptException originalExce
652652 wrapperException . Description = originalException . Description ;
653653
654654 var wrapperScriptException = wrapperException as JsScriptException ;
655- if ( wrapperScriptException != null )
655+ if ( wrapperScriptException is not null )
656656 {
657657 wrapperScriptException . Type = originalException . Type ;
658658 wrapperScriptException . DocumentName = originalException . DocumentName ;
@@ -798,7 +798,7 @@ public override bool HasVariable(string variableName)
798798 try
799799 {
800800 object variableValue = InnerGetVariableValue ( variableName ) ;
801- variableExist = variableValue != null ;
801+ variableExist = variableValue is not null ;
802802 }
803803 catch ( ActiveScriptException e )
804804 {
@@ -933,7 +933,7 @@ public override void Dispose()
933933 {
934934 if ( _disposedFlag . Set ( ) )
935935 {
936- if ( _debuggingStarted && _debugDocuments != null )
936+ if ( _debuggingStarted && _debugDocuments is not null )
937937 {
938938 foreach ( UIntPtr debugDocumentKey in _debugDocuments . Keys )
939939 {
@@ -945,11 +945,11 @@ public override void Dispose()
945945 _debugDocuments = null ;
946946 }
947947
948- if ( _processDebugManagerWrapper != null )
948+ if ( _processDebugManagerWrapper is not null )
949949 {
950950 _processDebugManagerWrapper . RemoveApplication ( _debugApplicationCookie ) ;
951951
952- if ( _debugApplicationWrapper != null )
952+ if ( _debugApplicationWrapper is not null )
953953 {
954954 _debugApplicationWrapper . Close ( ) ;
955955 _debugApplicationWrapper = null ;
@@ -958,28 +958,28 @@ public override void Dispose()
958958 _processDebugManagerWrapper = null ;
959959 }
960960
961- if ( _documentNames != null )
961+ if ( _documentNames is not null )
962962 {
963963 _documentNames . Clear ( ) ;
964964 _documentNames = null ;
965965 }
966966
967967 _dispatcher . Invoke ( ( ) =>
968968 {
969- if ( _dispatch != null )
969+ if ( _dispatch is not null )
970970 {
971971 Marshal . ReleaseComObject ( _dispatch ) ;
972972 _dispatch = null ;
973973 }
974974
975- if ( _activeScriptWrapper != null )
975+ if ( _activeScriptWrapper is not null )
976976 {
977977 _activeScriptWrapper . Dispose ( ) ;
978978 _activeScriptWrapper = null ;
979979 }
980980 } ) ;
981981
982- if ( _hostItems != null )
982+ if ( _hostItems is not null )
983983 {
984984 _hostItems . Clear ( ) ;
985985 _hostItems = null ;
0 commit comments