You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/05/23 03:22:19 UTC
js commit: updating transform to support bs paths
Repository: cordova-js
Updated Branches:
refs/heads/master 1d8fe40b7 -> 1c4ac0301
updating transform to support bs paths
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/1c4ac030
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/1c4ac030
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/1c4ac030
Branch: refs/heads/master
Commit: 1c4ac030122d5f285cbfdda5c04020b6a7176d86
Parents: 1d8fe40
Author: Anis Kadri <an...@apache.org>
Authored: Thu May 22 18:22:15 2014 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu May 22 18:22:15 2014 -0700
----------------------------------------------------------------------
tasks/lib/require-tr.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/1c4ac030/tasks/lib/require-tr.js
----------------------------------------------------------------------
diff --git a/tasks/lib/require-tr.js b/tasks/lib/require-tr.js
index b9a67ee..6b8c2e1 100644
--- a/tasks/lib/require-tr.js
+++ b/tasks/lib/require-tr.js
@@ -115,10 +115,14 @@ function _updateRequires(code) {
path.join(root, "src", "common", "$1"));
}
}
- else if(module !== undefined && module.indexOf("org.apache.cordova") !== -1 ) {
+ else if(module !== undefined && ( module.indexOf("org.apache.cordova") !== -1 ||
+ module.indexOf("./") === 0 ) ) {
var modules = requireTr.getModules();
+ if(module.indexOf("./") === 0) {
+ module = module.replace('/', '');
+ }
for(var i = 0, j = modules.length ; i < j ; i++) {
- if(module.match(modules[i].symbol)) {
+ if(module === modules[i].symbol || modules[i].symbol.indexOf(module) != -1) {
node.args[0].value = modules[i].path;
break;
}