Fix _.extend regression in IE < 9.

Former-commit-id: 65632fbbf3aaba0d9cd8578300f8025e311faff0
This commit is contained in:
John-David Dalton
2012-05-20 23:11:04 -04:00
parent d5966ae5db
commit 2e540368eb
4 changed files with 16 additions and 4 deletions

View File

@@ -5,7 +5,10 @@
<title>Backbone Test Suite</title>
<link rel="stylesheet" href="../vendor/backbone/test/vendor/qunit.css">
<style>
body > #qunit-header, #jslitmus {
body > #qunit-header {
display: none;
}
#jslitmus {
display: none;
}
</style>

View File

@@ -149,6 +149,14 @@
QUnit.module('lodash.extend');
(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() {
function Foo() {}
Foo.prototype.c = 3;