opened
kontur
username_0
The call to `Object.freeze`(https://github.com/username_1/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.
iOS 8.1 Javascript error in OTFeatureInfo.js
issue
created
graphicore
username_1
This looks like a strange bug in the iOS JS. The `obj`can't change within this function. Have you tried to searching for a bug in wherever iOS 8.1 Javascript is managed. iOS 8.1 JavaScript, what is this Mobile Safari?

We could `try ... catch` the call and just go without freezing there. It's more like an API measure to make it explicit that the data in the module shouldn't be changed, maybe even a bit paranoid. If we don't freeze on systems we develop on, it's not  changing anything.
comment
created
graphicore
username_1
Thinking about this, it could well be that `Object.freeze` is not defined in old browsers.

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:

```js
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?
comment
created
kontur
username_0
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: https://github.com/username_0/specimenTools/commit/753d5b2d01dafb67b9c8a82168aa7660607cce52

However, I get another javascript error that seems to also appear only on that outdated iOS version. [Here](https://github.com/username_1/specimenTools/blob/master/lib/services/FontsData.js#L188) the error is `undefined is not a function`
comment
created
graphicore
username_1
In this case [`codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)  is probably not defined. It's a newer replacement for [`charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt)

There's a [Polyfill](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt#Polyfill) though.
comment
created
kontur
username_0
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](https://github.com/username_0/specimenTools/tree/ios-8-1-fix)
comment