How to deal with the JavaScript dynamic method/field modifications

JavaScript is a prototyped based language. For a more in depth view of prototype based languages versus class based, checkout this article at Mozilla MDC.

When converting JavaScript to Java, we have to figure out how to deal with these dynamic properties. It is easy to deal with new fields, as every object can contain a Hashmap named dynamicProperties. Anytime a new property is generated, just stuff it in the Hashmap. We're still stuck on how to deal with dynamic methods... we may be stuck interpreting those :(.