You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by sc...@apache.org on 2010/02/05 22:16:14 UTC

svn commit: r907096 - /incubator/wookie/trunk/WebContent/shared/js/wookie-wrapper.js

Author: scottbw
Date: Fri Feb  5 21:16:14 2010
New Revision: 907096

URL: http://svn.apache.org/viewvc?rev=907096&view=rev
Log:
Changed the behaviour of preferences such that a request for a non-existing preference returns undefined instead of null; also calling clear or removeItem on a preference deletes it rather than setting it to null. This enables us to pass the "au" conformance test for W3C Widgets: Widget Interface (see http://dev.w3.org/2006/waf/widgets-api/test-suite/)

Modified:
    incubator/wookie/trunk/WebContent/shared/js/wookie-wrapper.js

Modified: incubator/wookie/trunk/WebContent/shared/js/wookie-wrapper.js
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/WebContent/shared/js/wookie-wrapper.js?rev=907096&r1=907095&r2=907096&view=diff
==============================================================================
--- incubator/wookie/trunk/WebContent/shared/js/wookie-wrapper.js (original)
+++ incubator/wookie/trunk/WebContent/shared/js/wookie-wrapper.js Fri Feb  5 21:16:14 2010
@@ -38,7 +38,7 @@
 		};
 	}
 	this.getItem = function(key){
-		if (!this.prefs[key]) return null;
+		if (!this.prefs[key]) return undefined;
 		return this.prefs[key]["dvalue"];
 	}
 	this.setItem = function(key,value){
@@ -71,7 +71,7 @@
             	window.DOMException.code = DOMException.NO_MODIFICATION_ALLOWED_ERR;
             	throw (window.DOMException);
             } else {
-            	this.prefs[key] = null;
+            	delete this.prefs[key];
             	Widget.setPreferenceForKey(key,null);
             	this.calcLength();
             }