mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Fix _.extend regression in IE < 9.
Former-commit-id: 65632fbbf3aaba0d9cd8578300f8025e311faff0
This commit is contained in:
@@ -248,11 +248,12 @@
|
|||||||
'init': 'object',
|
'init': 'object',
|
||||||
'top':
|
'top':
|
||||||
'for (var source, sourceIndex = 1, length = arguments.length; sourceIndex < length; sourceIndex++) {\n' +
|
'for (var source, sourceIndex = 1, length = arguments.length; sourceIndex < length; sourceIndex++) {\n' +
|
||||||
' source = arguments[sourceIndex]',
|
' source = arguments[sourceIndex];\n' +
|
||||||
|
(hasDontEnumBug ? ' if (source) {' : ''),
|
||||||
'loopExp': 'index in source',
|
'loopExp': 'index in source',
|
||||||
'useHas': false,
|
'useHas': false,
|
||||||
'inLoop': 'object[index] = source[index]',
|
'inLoop': 'object[index] = source[index]',
|
||||||
'bottom': '}'
|
'bottom': (hasDontEnumBug ? ' }\n' : '') + '}'
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Reusable iterator options for `filter` and `reject` */
|
/** Reusable iterator options for `filter` and `reject` */
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
}());
|
}());
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var sibling = document.scripts[0],
|
var sibling = document.getElementsByTagName('script')[0],
|
||||||
script = document.createElement('script');
|
script = document.createElement('script');
|
||||||
|
|
||||||
document.getElementById('FirebugUI').style.height = '100%';
|
document.getElementById('FirebugUI').style.height = '100%';
|
||||||
|
|||||||
@@ -5,7 +5,10 @@
|
|||||||
<title>Backbone Test Suite</title>
|
<title>Backbone Test Suite</title>
|
||||||
<link rel="stylesheet" href="../vendor/backbone/test/vendor/qunit.css">
|
<link rel="stylesheet" href="../vendor/backbone/test/vendor/qunit.css">
|
||||||
<style>
|
<style>
|
||||||
body > #qunit-header, #jslitmus {
|
body > #qunit-header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#jslitmus {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -149,6 +149,14 @@
|
|||||||
QUnit.module('lodash.extend');
|
QUnit.module('lodash.extend');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
test('should not error on `null` or `undefined` sources (test in IE < 9)', function() {
|
||||||
|
try {
|
||||||
|
deepEqual(_.extend({}, null, undefined, { 'a': 1 }), { 'a': 1 });
|
||||||
|
} catch(e) {
|
||||||
|
ok(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() {
|
test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() {
|
||||||
function Foo() {}
|
function Foo() {}
|
||||||
Foo.prototype.c = 3;
|
Foo.prototype.c = 3;
|
||||||
|
|||||||
Reference in New Issue
Block a user