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