Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typed-functions breaks mathjs for iOS 9.3 #1062

Closed
jean-emmanuel opened this issue Mar 14, 2018 · 6 comments
Closed

Typed-functions breaks mathjs for iOS 9.3 #1062

jean-emmanuel opened this issue Mar 14, 2018 · 6 comments
Labels

Comments

@jean-emmanuel
Copy link
Contributor

jean-emmanuel commented Mar 14, 2018

https://github.com/josdejong/typed-function/blob/master/typed-function.js#L1096
This throws TypeError: Attempting to change value of a readonly property. thus preventing mathjs to load.
Tested with iOS 9.3 (can be reproduced with desktop safari 9.1).

@harrysarson
Copy link
Collaborator

I think the 'name' property of a function is configurable (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name) and so we can delete it first and then reassign it a value to work around this.

I don't think this will work on older browsers though. Is the name of a function used apart from as a debugging tool? If not then this entire line could be surrounded by a try-catch so that typed-function can still work when this breaks.

@jean-emmanuel
Copy link
Contributor Author

I don't think this will work on older browsers though.

I confirm, just tested that on safari 9.1 :
screenshot-2018-03-14-15 15 49

@josdejong josdejong added the bug label Mar 14, 2018
@josdejong
Copy link
Owner

Thanks for reporting this issue!

It should be easy to make a fallback for older browsers and browser that don't allow replacing a function name, will look into it within a few days.

@blackdynamo
Copy link

I am also seeing this on older android versions. Threw me for a loop cause didn't have a clue where the error was coming and it's just including the mathjs@4.0.0 release.

josdejong added a commit to josdejong/typed-function that referenced this issue Mar 17, 2018
@josdejong
Copy link
Owner

This should be fixed now in v4.0.1

@jean-emmanuel
Copy link
Contributor Author

Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants