Fixes Issue #1199.
Extraction of the module base path did not account for the possibility of a
'/' within the location hash. This change simply strips away the hash
before extracting the base.
Found by: JonathonIsTheBestNameEver
Patch by: jlabanca
Review by: knorton
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1276 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate-xs.js b/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate-xs.js
index 617d4e5..ac41617 100644
--- a/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate-xs.js
+++ b/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate-xs.js
@@ -110,7 +110,10 @@
base = baseElements[baseElements.length - 1].href;
} else {
// No base tag; the base must be the same as the document location.
- base = getDirectoryOfFile($doc.location.href);
+ var loc = $doc.location;
+ var href = loc.href;
+ base = getDirectoryOfFile(href.substr(0, href.length
+ - loc.hash.length));
}
} else if ((base.match(/^\w+:\/\//))) {
// If the URL is obviously absolute, do nothing.
diff --git a/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate.js b/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate.js
index 21edfbc..db7e76f 100644
--- a/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate.js
+++ b/dev/core/src/com/google/gwt/dev/util/SelectionScriptTemplate.js
@@ -127,7 +127,10 @@
base = baseElements[baseElements.length - 1].href;
} else {
// No base tag; the base must be the same as the document location.
- base = getDirectoryOfFile($doc.location.href);
+ var loc = $doc.location;
+ var href = loc.href;
+ base = getDirectoryOfFile(href.substr(0, href.length
+ - loc.hash.length));
}
} else if ((base.match(/^\w+:\/\//))) {
// If the URL is obviously absolute, do nothing.