This project has moved and is read-only. For the latest updates, please go here.

Support for dynamic objects?

Apr 8, 2012 at 7:06 PM


Is there a plan to support dynamic objects ?

I would like to write custom validation logic for dynamic objects at runtime. Probably Jurassic is using Reflection to get all the members in the object, it could check if the object is DynamicObject , and then call GetAllDynamicMembers() and complete the list.


Apr 10, 2012 at 7:41 AM

I know some people have added support for dynamic to Jurassic, see for example:

I'd be interested as to whether people find this useful - if so, I'd be amenable to incorporating it into the main Jurassic codebase.

Apr 12, 2012 at 5:09 PM

I for sure am in love with Rob's patch! :-) I'm still working around some head-scratching points (for example, should ScriptEngine.Global's type be dynamic or ObjectInstance? Each one has its drawbacks) but it's really awesome to be able to do without all those GetProperty / SetProperty / CallLateBound calls. It even makes porting code between Javascript and CSharp little more than a copy-and-paste matter, as long as you're willing to sacrifice some static-typing advantages, like being able to catch lots of typos at compile time (er, yes, I make quite a few typos myself ;-) ).

Apr 12, 2012 at 10:39 PM

I would definitely welcome the official addition of dynamic support.