You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by do...@apache.org on 2009/04/30 20:50:46 UTC

svn commit: r770391 - /incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js

Author: doll
Date: Thu Apr 30 18:50:45 2009
New Revision: 770391

URL: http://svn.apache.org/viewvc?rev=770391&view=rev
Log:
Patch from Lev Epshteyn for opensocial templates. 
Fixes bug when fetching data for template rendering. 


Modified:
    incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js

Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js?rev=770391&r1=770390&r2=770391&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js Thu Apr 30 18:50:45 2009
@@ -182,20 +182,12 @@
   return {
     
     /**
-     * Returns a map of existing data. This is used externally by both the
-     * opensocial-data and opensocial-templates feature, hence is
-     * not hidden, despite not being part of the spec.
+     * Returns a map of existing data.
      * @return {Object} A map of current data sets.
      * TODO: Add to the spec API?
      */
     getData : function() {
-      var data = {};
-      for (var key in dataSets) {
-        if (dataSets.hasOwnProperty(key)) {
-          data[key] = dataSets[key];
-        }
-      }
-      return data;
+      return dataSets;
     },
     
     /**
@@ -263,4 +255,3 @@
 opensocial.data.getDataContext = function() {
   return opensocial.data.DataContext;
 };
-



Re: svn commit: r770391 - /incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js

Posted by Paul Lindner <li...@inuus.com>.
The failing test follows..

The submitted code contradicts the test.  The test was supposed to  
insure that the returned object was a copy of the data, not a reference.

Anyone know what the correct behavior is?



DataContextTest.prototype.testPutDataSet = function() {
   var context = opensocial.data.getDataContext();

   context.putDataSet('key', 'value');
   this.assertEquals('value', context.getDataSet('key'));

   // Test that putting null and undefined don't change the value.
   // TODO: this seems wrong;  why not support removing data?
   context.putDataSet('key', null);
   this.assertEquals('value', context.getDataSet('key'));

   context.putDataSet('key', undefined);
   this.assertEquals('value', context.getDataSet('key'));
};

On Apr 30, 2009, at 3:04 PM, Vincent Siveton wrote:

> Hi,
>
> Hudson is not happy after this commit
> http://hudson.zones.apache.org/hudson/view/Shindig/job/Shindig/679/
>
> Ok it is not a new requirement: why we *can't* add a notifier to dev@
> for Hudson?
> If technically we can't, I don't think a CI is useful for the  
> community.
>
> Cheers,
>
> Vincent
>
> 2009/4/30  <do...@apache.org>:
>> Author: doll
>> Date: Thu Apr 30 18:50:45 2009
>> New Revision: 770391
>>
>> URL: http://svn.apache.org/viewvc?rev=770391&view=rev
>> Log:
>> Patch from Lev Epshteyn for opensocial templates.
>> Fixes bug when fetching data for template rendering.
>>
>>
>> Modified:
>>    incubator/shindig/trunk/features/src/main/javascript/features/ 
>> opensocial-data-context/datacontext.js
>>
>> Modified: incubator/shindig/trunk/features/src/main/javascript/ 
>> features/opensocial-data-context/datacontext.js
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js?rev=770391&r1=770390&r2=770391&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- incubator/shindig/trunk/features/src/main/javascript/features/ 
>> opensocial-data-context/datacontext.js (original)
>> +++ incubator/shindig/trunk/features/src/main/javascript/features/ 
>> opensocial-data-context/datacontext.js Thu Apr 30 18:50:45 2009
>> @@ -182,20 +182,12 @@
>>   return {
>>
>>     /**
>> -     * Returns a map of existing data. This is used externally by  
>> both the
>> -     * opensocial-data and opensocial-templates feature, hence is
>> -     * not hidden, despite not being part of the spec.
>> +     * Returns a map of existing data.
>>      * @return {Object} A map of current data sets.
>>      * TODO: Add to the spec API?
>>      */
>>     getData : function() {
>> -      var data = {};
>> -      for (var key in dataSets) {
>> -        if (dataSets.hasOwnProperty(key)) {
>> -          data[key] = dataSets[key];
>> -        }
>> -      }
>> -      return data;
>> +      return dataSets;
>>     },
>>
>>     /**
>> @@ -263,4 +255,3 @@
>>  opensocial.data.getDataContext = function() {
>>   return opensocial.data.DataContext;
>>  };
>> -
>>
>>
>>


Re: svn commit: r770391 - /incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js

Posted by Vincent Siveton <vi...@gmail.com>.
Thanks Ian!

Vincent

2009/5/1 Ian Boston <ie...@tfd.co.uk>:
>
> On 30 Apr 2009, at 23:04, Vincent Siveton wrote:
>
>> Ok it is not a new requirement: why we *can't* add a notifier to dev@
>> for Hudson?
>
> Done,
> It will email the list on every unstable build.
> I haven't set it up to email the committer who broke the build, if people
> want that please shout.
>
> Also, we many need to subscribe hudson, sorry moderators if you get spammed
> by Hudson.
> If there are problems please shout.
> Ian
>
>

Re: svn commit: r770391 - /incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js

Posted by Ian Boston <ie...@tfd.co.uk>.
On 30 Apr 2009, at 23:04, Vincent Siveton wrote:

> Ok it is not a new requirement: why we *can't* add a notifier to dev@
> for Hudson?

Done,
It will email the list on every unstable build.
I haven't set it up to email the committer who broke the build, if  
people want that please shout.

Also, we many need to subscribe hudson, sorry moderators if you get  
spammed by Hudson.
If there are problems please shout.
Ian


Re: svn commit: r770391 - /incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js

Posted by Paul Lindner <li...@inuus.com>.
I reverted two changes that were causing the broken build/tests.

Turns out that moving to HtmlUnit 2.5 caused the opensocial templates  
test to fail.

Can someone with more knowledge of that part of the code take a peek  
at that and the datacontext.js change below?


On Apr 30, 2009, at 3:04 PM, Vincent Siveton wrote:

> Hi,
>
> Hudson is not happy after this commit
> http://hudson.zones.apache.org/hudson/view/Shindig/job/Shindig/679/
>
> Ok it is not a new requirement: why we *can't* add a notifier to dev@
> for Hudson?
> If technically we can't, I don't think a CI is useful for the  
> community.
>
> Cheers,
>
> Vincent
>
> 2009/4/30  <do...@apache.org>:
>> Author: doll
>> Date: Thu Apr 30 18:50:45 2009
>> New Revision: 770391
>>
>> URL: http://svn.apache.org/viewvc?rev=770391&view=rev
>> Log:
>> Patch from Lev Epshteyn for opensocial templates.
>> Fixes bug when fetching data for template rendering.
>>
>>
>> Modified:
>>    incubator/shindig/trunk/features/src/main/javascript/features/ 
>> opensocial-data-context/datacontext.js
>>
>> Modified: incubator/shindig/trunk/features/src/main/javascript/ 
>> features/opensocial-data-context/datacontext.js
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js?rev=770391&r1=770390&r2=770391&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- incubator/shindig/trunk/features/src/main/javascript/features/ 
>> opensocial-data-context/datacontext.js (original)
>> +++ incubator/shindig/trunk/features/src/main/javascript/features/ 
>> opensocial-data-context/datacontext.js Thu Apr 30 18:50:45 2009
>> @@ -182,20 +182,12 @@
>>   return {
>>
>>     /**
>> -     * Returns a map of existing data. This is used externally by  
>> both the
>> -     * opensocial-data and opensocial-templates feature, hence is
>> -     * not hidden, despite not being part of the spec.
>> +     * Returns a map of existing data.
>>      * @return {Object} A map of current data sets.
>>      * TODO: Add to the spec API?
>>      */
>>     getData : function() {
>> -      var data = {};
>> -      for (var key in dataSets) {
>> -        if (dataSets.hasOwnProperty(key)) {
>> -          data[key] = dataSets[key];
>> -        }
>> -      }
>> -      return data;
>> +      return dataSets;
>>     },
>>
>>     /**
>> @@ -263,4 +255,3 @@
>>  opensocial.data.getDataContext = function() {
>>   return opensocial.data.DataContext;
>>  };
>> -
>>
>>
>>


Re: svn commit: r770391 - /incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js

Posted by Vincent Siveton <vi...@gmail.com>.
Hi,

Hudson is not happy after this commit
http://hudson.zones.apache.org/hudson/view/Shindig/job/Shindig/679/

Ok it is not a new requirement: why we *can't* add a notifier to dev@
for Hudson?
If technically we can't, I don't think a CI is useful for the community.

Cheers,

Vincent

2009/4/30  <do...@apache.org>:
> Author: doll
> Date: Thu Apr 30 18:50:45 2009
> New Revision: 770391
>
> URL: http://svn.apache.org/viewvc?rev=770391&view=rev
> Log:
> Patch from Lev Epshteyn for opensocial templates.
> Fixes bug when fetching data for template rendering.
>
>
> Modified:
>    incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js
>
> Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js?rev=770391&r1=770390&r2=770391&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js (original)
> +++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data-context/datacontext.js Thu Apr 30 18:50:45 2009
> @@ -182,20 +182,12 @@
>   return {
>
>     /**
> -     * Returns a map of existing data. This is used externally by both the
> -     * opensocial-data and opensocial-templates feature, hence is
> -     * not hidden, despite not being part of the spec.
> +     * Returns a map of existing data.
>      * @return {Object} A map of current data sets.
>      * TODO: Add to the spec API?
>      */
>     getData : function() {
> -      var data = {};
> -      for (var key in dataSets) {
> -        if (dataSets.hasOwnProperty(key)) {
> -          data[key] = dataSets[key];
> -        }
> -      }
> -      return data;
> +      return dataSets;
>     },
>
>     /**
> @@ -263,4 +255,3 @@
>  opensocial.data.getDataContext = function() {
>   return opensocial.data.DataContext;
>  };
> -
>
>
>