[Pkg-javascript-commits] [dojo] 13/87: backport [27264]; refs #13183; !strict

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


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

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

commit da357c90b147e25d8f7e397d669b1957f2fda56b
Author: Rawld Gill <rgill at altoviso.com>
Date:   Tue Dec 6 08:17:07 2011 +0000

    backport [27264]; refs #13183; !strict
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.7/dojo@27298 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 _base/loader.js | 22 +---------------------
 dojo.js         | 21 +++++++++++++++++++--
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/_base/loader.js b/_base/loader.js
index ddb1a8c..4f22da5 100644
--- a/_base/loader.js
+++ b/_base/loader.js
@@ -12,26 +12,6 @@ define(["./kernel", "../has", "require", "module", "./json", "./lang", "./array"
 		return 0;
 	}
 
-	var isXdUrl = function(){ return 0;};
-	if(has("dom")){
-		var locationProtocol = location.protocol,
-			locationHost = location.host,
-			fileProtocol = !locationHost;
-		isXdUrl = function(url){
-			if(fileProtocol || /^\./.test(url)){
-				// begins with a dot is always relative to page URL; therefore not xdomain
-				return false;
-			}
-			if(/^\/\//.test(url)){
-				// for v1.6- backcompat, url starting with // indicates xdomain
-				return true;
-			}
-			// get protocol and host
-			var match = url.match(/^([^\/\:]+\:)\/\/([^\/]+)/);
-			return match && (match[1] != locationProtocol || match[2] != locationHost);
-		};
-	}
-
 	var makeErrorToken = function(id){
 			return {src:thisModule.id, id:id};
 		},
@@ -343,7 +323,7 @@ define(["./kernel", "../has", "require", "module", "./json", "./lang", "./array"
 			    "define(" + dojo.toJson(names.concat(["dojo/loadInit!"+id])) + ", function(" + names.join(",") + "){\n" + extractResult[0] + "});";
 		},
 
-		loaderVars = require.initSyncLoader(dojoRequirePlugin, checkDojoRequirePlugin, transformToAmd, isXdUrl),
+		loaderVars = require.initSyncLoader(dojoRequirePlugin, checkDojoRequirePlugin, transformToAmd),
 
 		sync =
 			loaderVars.sync,
diff --git a/dojo.js b/dojo.js
index dc4dc12..1d6c082 100644
--- a/dojo.js
+++ b/dojo.js
@@ -201,12 +201,12 @@
 		getXhr;
 	if(has("dojo-sync-loader")){
 		req.isXdUrl = noop;
-		req.initSyncLoader = function(dojoRequirePlugin_, checkDojoRequirePlugin_, transformToAmd_, isXdUrl_){
+
+		req.initSyncLoader = function(dojoRequirePlugin_, checkDojoRequirePlugin_, transformToAmd_){
 			if(!dojoRequirePlugin){
 				dojoRequirePlugin = dojoRequirePlugin_;
 				checkDojoRequirePlugin = checkDojoRequirePlugin_;
 				transformToAmd = transformToAmd_;
-				req.isXdUrl = isXdUrl_;
 			}
 			return {
 				sync:sync,
@@ -237,6 +237,23 @@
 			// replaced by dojo.getXhr() which allows for both sync and async op(and other features. It is not a problem
 			// depending on dojo for the sync loader since the sync loader will never be used without dojo.
 
+			var locationProtocol = location.protocol,
+				locationHost = location.host,
+				fileProtocol = !locationHost;
+			req.isXdUrl = function(url){
+				if(fileProtocol || /^\./.test(url)){
+					// begins with a dot is always relative to page URL; therefore not xdomain
+					return false;
+				}
+				if(/^\/\//.test(url)){
+					// for v1.6- backcompat, url starting with // indicates xdomain
+					return true;
+				}
+				// get protocol and host
+				var match = url.match(/^([^\/\:]+\:)\/\/([^\/]+)/);
+				return match && (match[1] != locationProtocol || match[2] != locationHost);
+			};
+
 			// note: to get the file:// protocol to work in FF, you must set security.fileuri.strict_origin_policy to false in about:config
 			has.add("dojo-xhr-factory", 1);
 			has.add("dojo-force-activex-xhr", has("host-browser") && !doc.addEventListener && window.location.protocol == "file:");

-- 
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