Skip to content

Commit

Permalink
fix: use Symbol.species in evaluated static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
stropitek authored and targos committed Aug 24, 2016
1 parent fee325e commit 39800f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/abstractMatrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ function abstractMatrix(superCtor) {

var staticOperator = `
(function %name%(matrix, value) {
var newMatrix = new this(matrix);
var newMatrix = new this[Symbol.species](matrix);
return newMatrix.%name%(value);
})
`;
Expand All @@ -1589,7 +1589,7 @@ function abstractMatrix(superCtor) {

var staticMethod = `
(function %name%(matrix) {
var newMatrix = new this(matrix);
var newMatrix = new this[Symbol.species](matrix);
return newMatrix.%name%();
})
`;
Expand All @@ -1607,7 +1607,7 @@ function abstractMatrix(superCtor) {

var staticMethodWithArgs = `
(function %name%(matrix, %args%) {
var newMatrix = new this(matrix);
var newMatrix = new this[Symbol.species](matrix);
return newMatrix.%name%(%args%);
})
`;
Expand Down

0 comments on commit 39800f9

Please sign in to comment.