[Pkg-javascript-commits] [dojo] 03/12: Leave encoding/decoding up to user. Patch from retchless. Fixes #10595, Refs #7925 !strict

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:00 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.4.5
in repository dojo.

commit 3f7a66e95520cef6875d3cf2bf35d42318acbb79
Author: Adam Peller <github at peller.org>
Date:   Tue Jan 19 22:02:38 2010 +0000

    Leave encoding/decoding up to user.  Patch from retchless.  Fixes #10595, Refs #7925 !strict
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.4/dojo@21190 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 hash.js       |  2 +-
 tests/hash.js | 28 ++++++++++++++--------------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/hash.js b/hash.js
index 5a7cc76..85d9243 100644
--- a/hash.js
+++ b/hash.js
@@ -51,7 +51,7 @@ dojo.provide("dojo.hash");
 	//Internal functions
 	function _getHash(){
 		var h = location.href, i = h.indexOf("#");
-		return (i >= 0) ? decodeURIComponent(h.substring(i + 1)) : "";
+		return (i >= 0) ? h.substring(i + 1) : "";
 	}
 
 	function _dispatchEvent(){
diff --git a/tests/hash.js b/tests/hash.js
index ab30764..f94a6c0 100644
--- a/tests/hash.js
+++ b/tests/hash.js
@@ -11,7 +11,7 @@ dojo.require("dojo.hash");
 	
 	function getHash(){
 		var h = location.href, i = h.indexOf("#");
-		return (i >= 0) ? decodeURIComponent(h.substring(i + 1)) : "";
+		return (i >= 0) ? h.substring(i + 1) : "";
 	}
 
 	tests.register("tests.hash", [
@@ -61,24 +61,24 @@ dojo.require("dojo.hash");
 		},
 		// hash with spaces
 		{
-			name: "Getting the hash of 'test with spaces'",
+			name: "Getting the hash of 'test%20with%20spaces'",
 			setUp: function(){
 				setHash('test%20with%20spaces');
 			},
 			runTest: function(t){
-				t.is('test with spaces', dojo.hash());
+				t.is('test%20with%20spaces', dojo.hash());
 			},
 			tearDown: function(){
 				setHash();
 			}
 		},
 		{
-			name: "Setting the hash to 'test with spaces'",
+			name: "Setting the hash of 'test%20with%20spaces'",
 			setUp: function(){
-				dojo.hash('test with spaces');
+				setHash('test%20with%20spaces');
 			},
 			runTest: function(t){
-				t.is('test with spaces', getHash());
+				t.is('test%20with%20spaces', getHash());
 			},
 			tearDown: function(){
 				setHash();
@@ -111,24 +111,24 @@ dojo.require("dojo.hash");
 		},
 		// hash with leading space
 		{
-			name: "Getting the hash of ' leadingSpace'",
+			name: "Getting the hash of '%20leadingSpace'",
 			setUp: function(){
 				setHash('%20leadingSpace');
 			},
 			runTest: function(t){
-				t.is(' leadingSpace', dojo.hash());
+				t.is('%20leadingSpace', dojo.hash());
 			},
 			tearDown: function(){
 				setHash();
 			}
 		},
 		{
-			name: "Setting the hash to ' leadingSpace'",
+			name: "Setting the hash to '%20leadingSpace'",
 			setUp: function(){
 				dojo.hash('%20leadingSpace');
 			},
 			runTest: function(t){
-				t.is(' leadingSpace', getHash());
+				t.is('%20leadingSpace', getHash());
 			},
 			tearDown: function(){
 				setHash();
@@ -137,24 +137,24 @@ dojo.require("dojo.hash");
 		
 		// hash with trailing space:
 		{
-			name: "Getting the hash of 'trailingSpace '",
+			name: "Getting the hash of 'trailingSpace%20'",
 			setUp: function(){
 				setHash('trailingSpace%20');
 			},
 			runTest: function(t){
-				t.is('trailingSpace ', dojo.hash());
+				t.is('trailingSpace%20', dojo.hash());
 			},
 			tearDown: function(){
 				setHash();
 			}
 		},
 		{
-			name: "Setting the hash to 'trailingSpace '",
+			name: "Setting the hash to 'trailingSpace%20'",
 			setUp: function(){
 				dojo.hash('trailingSpace%20');
 			},
 			runTest: function(t){
-				t.is('trailingSpace ', getHash());
+				t.is('trailingSpace%20', getHash());
 			},
 			tearDown: function(){
 				setHash();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list