mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Use the buildPath and otherPath in the logged perf status updates.
Former-commit-id: 0f1301e68dca84c0f72459bcfed11b3cc55cb577
This commit is contained in:
@@ -33,13 +33,13 @@
|
||||
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||
<script src="perf-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.buildName + '.js"><\/script>');
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
</script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.otherName + '.js"><\/script>');
|
||||
document.write('<script src="../' + ui.otherPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="perf.js"></script>
|
||||
<script>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/** The other library to load */
|
||||
var other = (/other=([^&]+)/.exec(location.search) || [])[1];
|
||||
|
||||
/** The UI object */
|
||||
/** The `ui` object */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -31,27 +31,29 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
ui.buildName = (function() {
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-dev': return 'lodash';
|
||||
case 'lodash-custom': return 'lodash.custom.min';
|
||||
case 'lodash-custom-debug': return 'lodash.custom';
|
||||
case 'lodash-dev': return 'lodash.js';
|
||||
case 'lodash-underscore': return 'lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
}
|
||||
return 'lodash.min';
|
||||
return 'lodash.min.js';
|
||||
}());
|
||||
|
||||
ui.otherName = (function() {
|
||||
// expose other library file path
|
||||
ui.otherPath = (function() {
|
||||
switch (other) {
|
||||
case 'lodash-dev': return 'lodash';
|
||||
case 'lodash-prod': return 'lodash.min';
|
||||
case 'lodash-custom': return 'lodash.custom.min';
|
||||
case 'lodash-custom-debug': return 'lodash.custom';
|
||||
case 'underscore-dev': return 'vendor/underscore/underscore';
|
||||
case 'lodash-dev': return 'lodash.js';
|
||||
case 'lodash-prod': return 'lodash.min.js';
|
||||
case 'lodash-underscore': return 'lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
case 'underscore-dev': return 'vendor/underscore/underscore.js';
|
||||
}
|
||||
return 'vendor/underscore/underscore-min';
|
||||
return 'vendor/underscore/underscore-min.js';
|
||||
}());
|
||||
|
||||
// initialize dropdowns
|
||||
// initialize controls
|
||||
addListener(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
|
||||
@@ -74,8 +76,8 @@
|
||||
'<select id="perf-build">' +
|
||||
'<option value="lodash-dev">Lo-Dash</option>' +
|
||||
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom)</option>' +
|
||||
'<option value="lodash-custom-debug">Custom (debug)</option>' +
|
||||
'</select>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
@@ -87,8 +89,8 @@
|
||||
'<option value="underscore-prod">Underscore (minified)</option>' +
|
||||
'<option value="lodash-dev">Lo-Dash</option>' +
|
||||
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom)</option>' +
|
||||
'<option value="lodash-custom-debug">Lo-Dash (custom debug)</option>' +
|
||||
'</select>';
|
||||
|
||||
var buildList = span1.lastChild,
|
||||
@@ -101,8 +103,8 @@
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-dev': return 0;
|
||||
case 'lodash-custom': return 2;
|
||||
case 'lodash-custom-debug': return 3;
|
||||
case 'lodash-underscore': return 2;
|
||||
case 'lodash-custom': return 3;
|
||||
}
|
||||
return 1;
|
||||
}());
|
||||
@@ -112,8 +114,8 @@
|
||||
case 'underscore-dev': return 0;
|
||||
case 'lodash-dev': return 2;
|
||||
case 'lodash-prod': return 3;
|
||||
case 'lodash-custom': return 4;
|
||||
case 'lodash-custom-debug': return 5;
|
||||
case 'lodash-underscore': return 4;
|
||||
case 'lodash-custom': return 5;
|
||||
}
|
||||
return 1;
|
||||
}());
|
||||
|
||||
403
perf/perf.js
403
perf/perf.js
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@
|
||||
</script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.buildName + '.js"><\/script>');
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="../vendor/backbone/backbone.js"></script>
|
||||
<script src="../vendor/backbone/test/environment.js"></script>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
Object.keys = function() { return []; };
|
||||
|
||||
// load Lo-Dash and expose it to the bad `Object.keys` shim
|
||||
document.write('<script src="../' + ui.buildName + '.js"><\/script>');
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
// store Lo-Dash to test for bad shim detection
|
||||
@@ -33,7 +33,7 @@
|
||||
delete Object._keys;
|
||||
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
document.write('<script src="../' + ui.buildName + '.js"><\/script>');
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
|
||||
// load test.js if not using require.js
|
||||
document.write(QUnit.urlParams.norequire
|
||||
@@ -47,20 +47,24 @@
|
||||
shimmedModule,
|
||||
underscoreModule;
|
||||
|
||||
window.require && require({
|
||||
'baseUrl': '../vendor/requirejs/',
|
||||
'urlArgs': 't=' + (+new Date),
|
||||
'paths': {
|
||||
'lodash': '../../' + ui.buildName,
|
||||
'shimmed': './../../' + ui.buildName,
|
||||
'underscore': '../underscore/../../' + ui.buildName
|
||||
},
|
||||
'shim': {
|
||||
'shimmed': {
|
||||
'exports': '_'
|
||||
window.require && require(
|
||||
(function() {
|
||||
var modulePath = ui.buildPath.replace(/\.js$/, '');
|
||||
return {
|
||||
'baseUrl': '../vendor/requirejs/',
|
||||
'urlArgs': 't=' + (+new Date),
|
||||
'paths': {
|
||||
'lodash': '../../' + modulePath,
|
||||
'shimmed': './../../' + modulePath,
|
||||
'underscore': '../underscore/../../' + modulePath
|
||||
},
|
||||
'shim': {
|
||||
'shimmed': {
|
||||
'exports': '_'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}()),
|
||||
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
|
||||
if (lodash && lodash.noConflict) {
|
||||
lodashModule = lodash.noConflict();
|
||||
|
||||
@@ -15,14 +15,15 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose build name
|
||||
ui.buildName = (function() {
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-prod': return 'lodash.min';
|
||||
case 'lodash-custom': return 'lodash.custom.min';
|
||||
case 'lodash-custom-debug': return 'lodash.custom';
|
||||
case 'lodash-prod': return 'lodash.min.js';
|
||||
case 'lodash-underscore': return 'lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
case 'lodash-custom-debug': return 'lodash.custom'.js;
|
||||
}
|
||||
return 'lodash';
|
||||
return 'lodash.js';
|
||||
}());
|
||||
|
||||
// assign `QUnit.urlParams` properties
|
||||
@@ -56,8 +57,9 @@
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-prod': return 1;
|
||||
case 'lodash-custom': return 2;
|
||||
case 'lodash-custom-debug': return 3;
|
||||
case 'lodash-underscore': return 2;
|
||||
case 'lodash-custom': return 3;
|
||||
case 'lodash-custom-debug': return 4;
|
||||
}
|
||||
return 0;
|
||||
}());
|
||||
@@ -83,6 +85,7 @@
|
||||
'<select id="qunit-build">' +
|
||||
'<option value="lodash-dev">Developement</option>' +
|
||||
'<option value="lodash-prod">Production</option>' +
|
||||
'<option value="lodash-underscore">Underscore</option>' +
|
||||
'<option value="lodash-custom">Custom</option>' +
|
||||
'<option value="lodash-custom-debug">Custom (debug)</option>' +
|
||||
'</select>';
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.buildName + '.js"><\/script>');
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="../vendor/underscore/test/collections.js"></script>
|
||||
<script src="../vendor/underscore/test/arrays.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user