Decode custom test/perf build urls.

This commit is contained in:
John-David Dalton
2013-09-16 23:56:26 -07:00
parent 428c2097c7
commit 3daff8ab8a
2 changed files with 12 additions and 12 deletions

View File

@@ -5,10 +5,10 @@
var basePath = '../'; var basePath = '../';
/** The Lo-Dash build to load */ /** The Lo-Dash build to load */
var build = (/build=([^&]+)/.exec(location.search) || [])[1]; var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
/** The other library to load */ /** The other library to load */
var other = (/other=([^&]+)/.exec(location.search) || [])[1]; var other = (other = /other=([^&]+)/.exec(location.search)) && decodeURIComponent(other[1]);
/** The `ui` object */ /** The `ui` object */
var ui = {}; var ui = {};
@@ -51,7 +51,7 @@
case 'lodash-custom-dev': result = 'lodash.custom.js'; break; case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break; case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'lodash-modern': case 'lodash-modern':
case undefined: result = 'dist/lodash.min.js'; break; case null: result = 'dist/lodash.min.js'; break;
default: return build; default: return build;
} }
return basePath + result; return basePath + result;
@@ -70,7 +70,7 @@
case 'lodash-custom': result = 'lodash.custom.min.js'; break; case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break; case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
case 'underscore': case 'underscore':
case undefined: result = 'vendor/underscore/underscore-min.js'; break; case null: result = 'vendor/underscore/underscore-min.js'; break;
default: return other; default: return other;
} }
return basePath + result; return basePath + result;
@@ -141,7 +141,7 @@
case 'lodash-custom-dev': return 5; case 'lodash-custom-dev': return 5;
case 'lodash-custom': return 6; case 'lodash-custom': return 6;
case 'lodash-modern': case 'lodash-modern':
case undefined: return 3; case null: return 3;
} }
return -1; return -1;
}()); }());
@@ -157,7 +157,7 @@
case 'lodash-custom-dev': return 7; case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8; case 'lodash-custom': return 8;
case 'underscore': case 'underscore':
case undefined: return 1; case null: return 1;
} }
return -1; return -1;
}()); }());

View File

@@ -5,10 +5,10 @@
var basePath = '../'; var basePath = '../';
/** The Lo-Dash build to load */ /** The Lo-Dash build to load */
var build = (/build=([^&]+)/.exec(location.search) || [])[1]; var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
/** The module loader to use */ /** The module loader to use */
var loader = (/loader=([^&]+)/.exec(location.search) || [])[1]; var loader = (loader = /loader=([^&]+)/.exec(location.search)) && decodeURIComponent(loader[1]);
/** The `ui` object */ /** The `ui` object */
var ui = {}; var ui = {};
@@ -54,7 +54,7 @@
case 'lodash-custom-dev': result = 'lodash.custom.js'; break; case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break; case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'lodash-compat-dev': case 'lodash-compat-dev':
case undefined: result = 'lodash.js'; break; case null: result = 'lodash.js'; break;
default: return build; default: return build;
} }
return basePath + result; return basePath + result;
@@ -67,7 +67,7 @@
case 'curl': result = 'vendor/curl/dist/curl-kitchen-sink/curl.js'; break; case 'curl': result = 'vendor/curl/dist/curl-kitchen-sink/curl.js'; break;
case 'dojo': result = 'vendor/dojo/dojo.js'; break; case 'dojo': result = 'vendor/dojo/dojo.js'; break;
case 'requirejs': case 'requirejs':
case undefined: result = 'vendor/requirejs/require.js'; break; case null: result = 'vendor/requirejs/require.js'; break;
default: return loader; default: return loader;
} }
return basePath + result; return basePath + result;
@@ -113,7 +113,7 @@
case 'lodash-custom-dev': return 8; case 'lodash-custom-dev': return 8;
case 'lodash-custom': return 9; case 'lodash-custom': return 9;
case 'lodash-compat-dev': case 'lodash-compat-dev':
case undefined: return 0; case null: return 0;
} }
return -1; return -1;
}()); }());
@@ -124,7 +124,7 @@
case 'curl': return 1; case 'curl': return 1;
case 'dojo': return 2; case 'dojo': return 2;
case 'requirejs': case 'requirejs':
case undefined: return 3; case null: return 3;
} }
return -1; return -1;
}()); }());