Author: jasvir
Date: Fri May 27 15:35:21 2011
New Revision: 1128364
URL: http://svn.apache.org/viewvc?rev=1128364&view=rev
Log:
Patch from Felix Lee.
Description
Currently, when Caja is enabled, the data passed to an osapi callback is
read-only. The SocialHelloWorld demo tries to push a new element into that
read-only data, which fails. I might be able to modify the Caja taming to
return writeable data, but I have to think through the implications of that.
In the meantime, this patch modifies the demo to make a copy of the read-only
data.
Testing
Demo works in sample container with Caja enabled, on Chrome.
Modified:
shindig/trunk/content/samplecontainer/examples/SocialHelloWorld.xml
Modified: shindig/trunk/content/samplecontainer/examples/SocialHelloWorld.xml
URL:
http://svn.apache.org/viewvc/shindig/trunk/content/samplecontainer/examples/SocialHelloWorld.xml?rev=1128364&r1=1128363&r2=1128364&view=diff
==============================================================================
--- shindig/trunk/content/samplecontainer/examples/SocialHelloWorld.xml
(original)
+++ shindig/trunk/content/samplecontainer/examples/SocialHelloWorld.xml Fri May
27 15:35:21 2011
@@ -79,7 +79,8 @@
var allPeople, viewerFriendData;
function render(data) {
var viewer = data.viewer;
- allPeople = data.viewerFriends.list;
+ // When Caja is enabled, data is read-only, so make a writeable copy.
+ allPeople = data.viewerFriends.list.concat();
if (viewer) {
allPeople.push(viewer);
}