Skip to content

No longer ES5 compatible due to use of Symbol #2245

@Schnark

Description

@Schnark

The documentation says that math.js is still ES5 compatible. But trying to execute it in an old browser throws errors, because Symbol is undefined (which is ES6). Actually, Symbol is used in many places in the library, but in most cases there is a check to see whether it exists before it is accessed, but in three places this check is missing. As far as I can see (such old browsers aren't good for debugging, I am only told all 3 instances are in line 40 of https://cdnjs.cloudflare.com/ajax/libs/mathjs/9.4.2/math.js), these are the 3 instances: https://github.com/josdejong/mathjs/search?q=Symbol.iterator (Matrix, SparseMatrix, DenseMatrix)

Either you should guard them with a check for typeof Symbol !== 'undefined', or update the documentation to say that an ES6 compliant browser is required.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions