Thanks Kevin, I figured that out and realised I need to wrap everything in an object of some sort which is fine as that is good practice for an API anyway.
On Saturday, August 2, 2014 11:35:23 AM UTC+12, Kevin Reid wrote: > > > Unfortunately, the taming membrane's design prohibits what you want to do > here. Arrays and plain objects are always _copied_, and changes on one side > will not be reflected on the other. (The error you are seeing is not > because the 'push' method is unavailable, but because the array you get > from the membrane has been made unmodifiable.) This was done because with > the current baseline of browser functionality it is essentially impossible > to reliably mirror an array across the membrane (since it has an unbounded > set of property names). > > In order to share something modifiable between the two sides of the > membrane, make an object with methods (which can have internal state which > is an array, if you want — it doesn't matter to the membrane). If you do > this on the host side you'll need to mark its methods; on the guest side it > should automatically work when accessed from the host. > -- --- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
