@@ -138,6 +138,10 @@ public void V8ScriptEngine_AddHostObject_GlobalMembers()
138138 var host = new HostFunctions ( ) ;
139139 engine . AddHostObject ( "host" , HostItemFlags . GlobalMembers , host ) ;
140140 Assert . IsInstanceOfType ( engine . Evaluate ( "newObj()" ) , typeof ( PropertyBag ) ) ;
141+
142+ engine . AddHostObject ( "test" , HostItemFlags . GlobalMembers , this ) ;
143+ engine . Execute ( "TestProperty = newObj()" ) ;
144+ Assert . IsInstanceOfType ( TestProperty , typeof ( PropertyBag ) ) ;
141145 }
142146
143147 [ TestMethod , TestCategory ( "V8ScriptEngine" ) ]
@@ -168,6 +172,10 @@ public void V8ScriptEngine_AddHostType_GlobalMembers()
168172 {
169173 engine . AddHostType ( "Guid" , HostItemFlags . GlobalMembers , typeof ( Guid ) ) ;
170174 Assert . IsInstanceOfType ( engine . Evaluate ( "NewGuid()" ) , typeof ( Guid ) ) ;
175+
176+ engine . AddHostType ( "Test" , HostItemFlags . GlobalMembers , GetType ( ) ) ;
177+ engine . Execute ( "StaticTestProperty = NewGuid()" ) ;
178+ Assert . IsInstanceOfType ( StaticTestProperty , typeof ( Guid ) ) ;
171179 }
172180
173181 [ TestMethod , TestCategory ( "V8ScriptEngine" ) ]
@@ -636,6 +644,10 @@ function onStaticChange(s, e) {
636644 Property changed: Name; new value: Shane (static event)
637645 " ;
638646
647+ public object TestProperty { get ; set ; }
648+
649+ public static object StaticTestProperty { get ; set ; }
650+
639651 // ReSharper disable UnusedMember.Local
640652
641653 private void PrivateMethod ( )
0 commit comments