Skip to content

Commit

Permalink
'base' detection tests node src attribute before using it [fixes #252…
Browse files Browse the repository at this point in the history
…8425]. bootstrapped loader file uses same filter as the yui file. [fixes #2528208].
  • Loading branch information
Adam Moore committed Dec 2, 2009
1 parent 5a50046 commit 96ea8ab
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 100 deletions.
44 changes: 25 additions & 19 deletions build/yui/yui-base-debug.js
Expand Up @@ -138,7 +138,7 @@ YUI.prototype = {

// find targeted window/frame
// @TODO create facades
var v = '@VERSION@', Y = this;
var v = '@VERSION@', Y = this, filter;

if (v.indexOf('@') > -1) {
v = 'test';
Expand Down Expand Up @@ -190,27 +190,33 @@ YUI.prototype = {
for (i=0; i<nodes.length; i=i+1) {
src = nodes[i].src;

// DEBUG
//src = "http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js";
//console.log('src) ' + src);
// DEBUG
if (src) {
// DEBUG
//src = "http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js";
//console.log('src) ' + src);
// DEBUG
match = src.match(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/);
b = match && match[1];

match = src.match(/^(.*)yui\/yui[\.\-].*js(\?.*)?$/);
b = match && match[1];
// First stage base extraction
// console.log('1) ' + b);

// First stage base extraction
// console.log('1) ' + b);
if (b) {

filter = match[2];
console.log('filter: ' + filter);

if (b) {
// extract correct path for mixed combo urls
// http://yuilibrary.com/projects/yui3/ticket/2528423
// http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js
match = src.match(/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);
if (match && match[3]) {
b = match[1] + match[3];
}

break;
// extract correct path for mixed combo urls
// http://yuilibrary.com/projects/yui3/ticket/2528423
// http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js
match = src.match(/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);
if (match && match[3]) {
b = match[1] + match[3];
}

break;
}
}
}

Expand All @@ -221,7 +227,7 @@ YUI.prototype = {

}(),

loaderPath: 'loader/loader-min.js'
loaderPath: 'loader/loader' + (filter || '-min.') + 'js'
};

},
Expand Down
4 changes: 2 additions & 2 deletions build/yui/yui-base-min.js

Large diffs are not rendered by default.

44 changes: 25 additions & 19 deletions build/yui/yui-base.js
Expand Up @@ -138,7 +138,7 @@ YUI.prototype = {

// find targeted window/frame
// @TODO create facades
var v = '@VERSION@', Y = this;
var v = '@VERSION@', Y = this, filter;

if (v.indexOf('@') > -1) {
v = 'test';
Expand Down Expand Up @@ -190,27 +190,33 @@ YUI.prototype = {
for (i=0; i<nodes.length; i=i+1) {
src = nodes[i].src;

// DEBUG
//src = "http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js";
//console.log('src) ' + src);
// DEBUG
if (src) {
// DEBUG
//src = "http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js";
//console.log('src) ' + src);
// DEBUG
match = src.match(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/);
b = match && match[1];

match = src.match(/^(.*)yui\/yui[\.\-].*js(\?.*)?$/);
b = match && match[1];
// First stage base extraction
// console.log('1) ' + b);

// First stage base extraction
// console.log('1) ' + b);
if (b) {

filter = match[2];
console.log('filter: ' + filter);

if (b) {
// extract correct path for mixed combo urls
// http://yuilibrary.com/projects/yui3/ticket/2528423
// http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js
match = src.match(/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);
if (match && match[3]) {
b = match[1] + match[3];
}

break;
// extract correct path for mixed combo urls
// http://yuilibrary.com/projects/yui3/ticket/2528423
// http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js
match = src.match(/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);
if (match && match[3]) {
b = match[1] + match[3];
}

break;
}
}
}

Expand All @@ -221,7 +227,7 @@ YUI.prototype = {

}(),

loaderPath: 'loader/loader-min.js'
loaderPath: 'loader/loader' + (filter || '-min.') + 'js'
};

},
Expand Down
44 changes: 25 additions & 19 deletions build/yui/yui-debug.js
Expand Up @@ -138,7 +138,7 @@ YUI.prototype = {

// find targeted window/frame
// @TODO create facades
var v = '@VERSION@', Y = this;
var v = '@VERSION@', Y = this, filter;

if (v.indexOf('@') > -1) {
v = 'test';
Expand Down Expand Up @@ -190,27 +190,33 @@ YUI.prototype = {
for (i=0; i<nodes.length; i=i+1) {
src = nodes[i].src;

// DEBUG
//src = "http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js";
//console.log('src) ' + src);
// DEBUG
if (src) {
// DEBUG
//src = "http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js";
//console.log('src) ' + src);
// DEBUG
match = src.match(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/);
b = match && match[1];

match = src.match(/^(.*)yui\/yui[\.\-].*js(\?.*)?$/);
b = match && match[1];
// First stage base extraction
// console.log('1) ' + b);

// First stage base extraction
// console.log('1) ' + b);
if (b) {

filter = match[2];
console.log('filter: ' + filter);

if (b) {
// extract correct path for mixed combo urls
// http://yuilibrary.com/projects/yui3/ticket/2528423
// http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js
match = src.match(/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);
if (match && match[3]) {
b = match[1] + match[3];
}

break;
// extract correct path for mixed combo urls
// http://yuilibrary.com/projects/yui3/ticket/2528423
// http://yui.yahooapis.com/combo?2.8.0r4/build/yuiloader-dom-event/yuiloader-dom-event.js&3.0.0/build/yui/yui-min.js
match = src.match(/^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/);
if (match && match[3]) {
b = match[1] + match[3];
}

break;
}
}
}

Expand All @@ -221,7 +227,7 @@ YUI.prototype = {

}(),

loaderPath: 'loader/loader-min.js'
loaderPath: 'loader/loader' + (filter || '-min.') + 'js'
};

},
Expand Down

0 comments on commit 96ea8ab

Please sign in to comment.