-
Notifications
You must be signed in to change notification settings - Fork 6
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
iOS 8.1 Javascript error in OTFeatureInfo.js #21
Comments
This looks like a strange bug in the iOS JS. The We could |
Thinking about this, it could well be that The error would be something like "undefined is not a function" or "TypeError: Object.freeze is not a function." the message depends on the js interpreter. If so: function deepFreeze(obj) {
var k;
if(!Object.freeze) return;
if(typeof obj !== 'object') return;
for(k in obj)
deepFreeze(obj[k]);
Object.freeze(obj);
} this should do the trick. Could you try this out? |
Funnily enough this fails not because Object.freeze is not defined (it seems to be) nor because the obj passed in would not be a an object (at least according to typeof). Very odd. With a try-catch it can be made to not break, as per: kontur@753d5b2 However, I get another javascript error that seems to also appear only on that outdated iOS version. Here the error is |
In this case There's a Polyfill though. |
That seems to do the trick, no more iOS 8 errors at least on the test pages. I couldn't find any other places that have included a polyfill, so in this instance I included at inside the FontsData.js. I have my changes in this branch |
The call to
Object.freeze
(https://github.com/graphicore/specimenTools/blob/master/lib/services/OTFeatureInfo.js#L775) is causing an Javascript error in iOS 8.1.The code checks if obj is indeed of type 'object', but for this case it seems to be 'undefined' when it reaches this line.
I'm not entirely sure what is going on in this part of the code, so I thought I run this by you first.
The text was updated successfully, but these errors were encountered: