Bug Tracker

Opened 13 years ago

Closed 12 years ago

#6621 closed bug (wontfix)

urlFilter function on the omgrequire branch incorrectly handle namespaces

Reported by: tnadav Owned by:
Priority: undecided Milestone: 1.4.3
Component: unfiled Version:
Keywords: Cc:
Blocked by: Blocking:

Description

There is a bug in the urlFilter function (file core.js, line 759, branch omgrequire). If a defined namespace path has a dot in it, the function turns it into a foreword slash.

For example, when there is a namespace named test and it's path is http://www.jquery.com the function turn test.hello into http://www/jquery/com/hello.js.

that's because the function turns foreword slashes into dots after the namespace path is added, so the solution is to do it before the namespace path is added.

A fixed function would look like this: jQuery.require.urlFilter = function(url) {

if ( !/\./.test(url)
(/([\w\d$]+)./.test(url) && !/\.test( url ) && !/.js$/.test( url )) ) {

url = url.replace(/\./g, "/").replace(/([\w\d$]+)./, function(all, name) {

return (requireNamespaces[name]
name) + "/";

}) + ".js";

} return url;

}

Change History (2)

comment:1 Changed 13 years ago by tnadav

I'm adding a link for the fixed function so you can understand what is written http://gist.github.com/420899

comment:2 Changed 12 years ago by snover

Priority: undecided
Resolution: wontfix
Status: newclosed

omgrequire is not maintained.

Note: See TracTickets for help on using tickets.