Skip to content

Commit 39800f9

Browse files
stropitektargos
authored andcommitted
fix: use Symbol.species in evaluated static methods
1 parent fee325e commit 39800f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/abstractMatrix.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ function abstractMatrix(superCtor) {
15711571

15721572
var staticOperator = `
15731573
(function %name%(matrix, value) {
1574-
var newMatrix = new this(matrix);
1574+
var newMatrix = new this[Symbol.species](matrix);
15751575
return newMatrix.%name%(value);
15761576
})
15771577
`;
@@ -1589,7 +1589,7 @@ function abstractMatrix(superCtor) {
15891589

15901590
var staticMethod = `
15911591
(function %name%(matrix) {
1592-
var newMatrix = new this(matrix);
1592+
var newMatrix = new this[Symbol.species](matrix);
15931593
return newMatrix.%name%();
15941594
})
15951595
`;
@@ -1607,7 +1607,7 @@ function abstractMatrix(superCtor) {
16071607

16081608
var staticMethodWithArgs = `
16091609
(function %name%(matrix, %args%) {
1610-
var newMatrix = new this(matrix);
1610+
var newMatrix = new this[Symbol.species](matrix);
16111611
return newMatrix.%name%(%args%);
16121612
})
16131613
`;

0 commit comments

Comments
 (0)