Hi Tony,
Your code above creates a property (named "someNewProperty") whose value is a script object.
Fundamentally, a script object is not a standalone object; it can be considered a sort of reference into a script engine's in-memory state. Accessing the properties of a script object requires the services of the script engine that created it.
In your scenario, consider using a host object instead. For example:
and then:
Good luck!
Your code above creates a property (named "someNewProperty") whose value is a script object.
Fundamentally, a script object is not a standalone object; it can be considered a sort of reference into a script engine's in-memory state. Accessing the properties of a script object requires the services of the script engine that created it.
In your scenario, consider using a host object instead. For example:
// C# engine.AddHostType("ExpandoObject", typeof(ExpandoObject));
// JavaScript theObject.someNewProperty = new ExpandoObject(); theObject.someNewProperty.innerProperty1 = 10; theObject.someNewProperty.innerProperty2 = 'Hello world';