Skip to content

Commit

Permalink
fix: Call recreate in Array constructor
Browse files Browse the repository at this point in the history
finom committed Sep 20, 2016

Verified

This commit was signed with the committer’s verified signature.
re-taro Rintaro Itokawa
1 parent dcce619 commit a7df285
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/array/index.js
Original file line number Diff line number Diff line change
@@ -18,12 +18,11 @@ instanceMembers.constructor = function MatreshkaArray(length) {
// repeat the same logic as for native Array
if (arguments.length === 1 && typeof length === 'number') {
this.length = length;
} else {
nofn.forEach(arguments, (arg, index) => {
this[index] = itemMediator ? itemMediator(arg, index) : arg;
} else if(arguments.length) {
this.recreate(arguments, {
silent: true,
dontRender: true
});

this.length = arguments.length;
}

// return is used to make possible to chain super() calls

0 comments on commit a7df285

Please sign in to comment.