An example to share vb6 script control vs clearscript

In my current VB6 app I use scripting to plug in classes that the scripting can maniplate and also call functions within my plugged in classes to effect change and act as events in my main app. This is a bit of test code that shows the same capacity in
clearscript.

Thanks for sharing this sample, notahack! We're concerned about the comment indicating that the
Script property did not allow you to assign a global property. We're going to see if we can reproduce that.

It sure would be easier and more elegant if assigning a new object to a variable as as easy as V8JS.Script.TEST1 = T1;

​
ClearScript's test code uses this kind of assignment in many places; see the
V8ScriptEngine_Script_Property test for an example. We've just tested it with your
V8test class and setup code exactly as above and could not reproduce any issue. Does it still fail for you? If so, what are you seeing? Is there an exception?

The code above initially calls AddHostObject() to create the "TEST1" global property. What you may not realize - most likely because of insufficient documentation on our part - is that
AddHostobject() creates a read-only global property. Subsequent reassignment is quietly ignored. This is by design - to prevent script code from clobbering the host's API, and to achieve compatibility with ClearScript's original JScript/VBScript
behavior.

On the other hand, properties created via Script can be reassigned normally. Instead of: