-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
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.