mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Make backbone unit tests pass in IE6.
Former-commit-id: e709e017441d7902d5f09e6901cf4f586953723b
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<h1>Test</h1>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../vendor/json3/lib/json3.js"></script>
|
||||
<script src="../vendor/json-js/json2.js"></script>
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
@@ -26,7 +26,7 @@
|
||||
<script src="../lodash.js"></script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
_.mixin({
|
||||
|
||||
@@ -25,11 +25,8 @@
|
||||
<script src="test-ui.js"></script>
|
||||
<script>
|
||||
function init(lodash) {
|
||||
var arrayProto = Array.prototype,
|
||||
concat = arrayProto.concat,
|
||||
pop = arrayProto.pop,
|
||||
push = arrayProto.push,
|
||||
slice = arrayProto.slice;
|
||||
var arrayRef = [],
|
||||
push = arrayRef.push;
|
||||
|
||||
if (!lodash().map()) {
|
||||
return;
|
||||
@@ -51,6 +48,15 @@
|
||||
});
|
||||
};
|
||||
|
||||
lodash.forEach(['pop', 'shift'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
func.apply(this.__wrapped__, arguments);
|
||||
return this;
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
lodash.mixin(lodash);
|
||||
|
||||
// expose lodash
|
||||
@@ -116,7 +122,8 @@
|
||||
pluginPath + basePath + '/vendor/underscore/test/arrays.js',
|
||||
pluginPath + basePath + '/vendor/underscore/test/functions.js',
|
||||
pluginPath + basePath + '/vendor/underscore/test/objects.js',
|
||||
pluginPath + basePath + '/vendor/underscore/test/utility.js'
|
||||
pluginPath + basePath + '/vendor/underscore/test/utility.js',
|
||||
pluginPath + basePath + '/vendor/underscore/test/chaining.js'
|
||||
], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user