Skip to content

Commit fee325e

Browse files
stropitektargos
authored andcommitted
fix: use Symbol.species as Matrix constructor in selection
1 parent e5a8541 commit fee325e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/abstractMatrix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ function abstractMatrix(superCtor) {
14061406
*/
14071407
selection(rowIndices, columnIndices) {
14081408
var indices = util.checkIndices(this, rowIndices, columnIndices);
1409-
var newMatrix = new this.constructor(rowIndices.length, columnIndices.length);
1409+
var newMatrix = new this.constructor[Symbol.species](rowIndices.length, columnIndices.length);
14101410
for (var i = 0; i < indices.row.length; i++) {
14111411
var rowIndex = indices.row[i];
14121412
for (var j = 0; j < indices.column.length; j++) {

0 commit comments

Comments
 (0)