Make backbone unit tests pass in IE6.

Former-commit-id: e709e017441d7902d5f09e6901cf4f586953723b
This commit is contained in:
John-David Dalton
2013-08-26 00:05:00 -07:00
parent 83059a013c
commit e322f6dbe2
5 changed files with 501 additions and 862 deletions

View File

@@ -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({

View File

@@ -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();
});