mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Add case of 5 to createCtorWrapper to align with bindCallback.
This commit is contained in:
@@ -3429,6 +3429,7 @@
|
||||
case 2: return new Ctor(args[0], args[1]);
|
||||
case 3: return new Ctor(args[0], args[1], args[2]);
|
||||
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
|
||||
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
|
||||
}
|
||||
var thisBinding = baseCreate(Ctor.prototype),
|
||||
result = Ctor.apply(thisBinding, args);
|
||||
|
||||
@@ -1510,11 +1510,12 @@
|
||||
|
||||
test('should not error when calling bound class constructors', 1, function() {
|
||||
var createCtor = _.attempt(Function, '"use strict";return class A{}');
|
||||
|
||||
if (typeof createCtor == 'function') {
|
||||
var bound = _.bind(createCtor()),
|
||||
expected = _.times(5, _.constant(true));
|
||||
expected = _.times(6, _.constant(true));
|
||||
|
||||
var actual = _.times(5, function(index) {
|
||||
var actual = _.times(6, function(index) {
|
||||
try {
|
||||
switch (index) {
|
||||
case 0: return !!(new bound);
|
||||
@@ -1522,6 +1523,7 @@
|
||||
case 2: return !!(new bound(1, 2));
|
||||
case 3: return !!(new bound(1, 2, 3));
|
||||
case 4: return !!(new bound(1, 2, 3, 4));
|
||||
case 5: return !!(new bound(1, 2, 3, 4, 5));
|
||||
}
|
||||
} catch(e) {}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user