Permalink
Browse files

Merge branch 'master' into build

  • Loading branch information...
davglass committed Nov 29, 2011
2 parents 0075cea + bd0df39 commit 92ee814db9d1c947c2f35c15053775de92298d78
@@ -1443,7 +1443,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1435,7 +1435,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
@@ -1443,7 +1443,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1435,7 +1435,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
@@ -621,7 +621,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -619,7 +619,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
@@ -621,7 +621,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -619,7 +619,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
@@ -621,7 +621,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
@@ -5605,7 +5605,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -619,7 +619,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
@@ -5575,7 +5575,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
View
@@ -621,7 +621,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
@@ -6266,7 +6266,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -619,7 +619,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
@@ -6229,7 +6229,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
View
@@ -1353,7 +1353,7 @@ Y.Loader.prototype = {
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
- var go = def && ((def.ua && Y.UA[def.ua]) ||
+ var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
@@ -0,0 +1,3 @@
+YUI.add('cond', function(Y) {
+ Y.COND = true;
+});
@@ -0,0 +1,3 @@
+YUI.add('cond2', function(Y) {
+ Y.COND2 = true;
+});
@@ -255,6 +255,49 @@ YUI.add('loader-tests', function(Y) {
test.wait();
},
+ test_cond_with_test_function: function() {
+ var test = this;
+
+ YUI({
+ modules: {
+ cond2: {
+ fullpath: './assets/cond2.js',
+ condition: {
+ trigger: 'jsonp',
+ test: function() {
+ return true;
+ }
+ }
+ }
+ }
+ }).use('jsonp', function(Y) {
+ test.resume(function() {
+ Assert.isTrue(Y.COND2, 'Conditional module failed to load with test function');
+ });
+ });
+
+ test.wait();
+ },
+ test_cond_no_test_or_ua: function() {
+ var test = this;
+
+ YUI({
+ modules: {
+ cond: {
+ fullpath: './assets/cond.js',
+ condition: {
+ trigger: 'yql'
+ }
+ }
+ }
+ }).use('yql', function(Y) {
+ test.resume(function() {
+ Assert.isTrue(Y.COND, 'Conditional module failed to load with no test function or UA defined');
+ });
+ });
+
+ test.wait();
+ },
test_forcemap: function() {
var test = this;
View
@@ -621,7 +621,7 @@ with any configuration info required for the module.
//if (!loader || !loader.moduleInfo[name]) {
//if ((!loader || !loader.moduleInfo[name]) && !moot) {
- if (!moot) {
+ if (!moot && name) {
if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
Y.Env._missed.push(name);
Y.Env._missed = Y.Array.dedupe(Y.Env._missed);

0 comments on commit 92ee814

Please sign in to comment.