最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - TypeError: Attempted to assign to readonly property. on iOS8 Safari - Stack Overflow

programmeradmin0浏览0评论

Hi this page on my site works fine on desktop browser, but has a weird bug on iOS8 Safari:

The index template doesn't show up, and there's a error in the console:

TypeError: Attempted to assign to readonly property.

and it points to the following line:

}), e("rsvp/promise/all", ["../utils", "exports"], function(e, t) {
    "use strict";
    var r = e.isArray, n = e.isNonThenable;
    t["default"] = function(e, t) {
        var i = this;
        return new i(function(t, a) {
            function o(e) {
                return function(r) {
                    c[e] = r, 0===--u && t(c)
                }
            }
            function s(e) {
                u = 0, a(e)
            }
            if (!r(e))
                throw new TypeError("You must pass an array to all.");
            var l, u = e.length, c = new Array(u);
            if (0 === u) // This is the line with error
                return void t(c);
            for (var h = 0; h < e.length; h++)
                l = e[h], n(l) ? (c[h] = l, 0===--u && t(c)) : i.cast(l).then(o(h), s)
        }, t)
    }
}), e("rsvp/promise/cast", ["exports"], function(e) {
    "use strict";

Is it a known bug to mobile safari, is there fix of it?

Hi this page on my site works fine on desktop browser, but has a weird bug on iOS8 Safari:

The index template doesn't show up, and there's a error in the console:

TypeError: Attempted to assign to readonly property.

and it points to the following line:

}), e("rsvp/promise/all", ["../utils", "exports"], function(e, t) {
    "use strict";
    var r = e.isArray, n = e.isNonThenable;
    t["default"] = function(e, t) {
        var i = this;
        return new i(function(t, a) {
            function o(e) {
                return function(r) {
                    c[e] = r, 0===--u && t(c)
                }
            }
            function s(e) {
                u = 0, a(e)
            }
            if (!r(e))
                throw new TypeError("You must pass an array to all.");
            var l, u = e.length, c = new Array(u);
            if (0 === u) // This is the line with error
                return void t(c);
            for (var h = 0; h < e.length; h++)
                l = e[h], n(l) ? (c[h] = l, 0===--u && t(c)) : i.cast(l).then(o(h), s)
        }, t)
    }
}), e("rsvp/promise/cast", ["exports"], function(e) {
    "use strict";

Is it a known bug to mobile safari, is there fix of it?

Share Improve this question asked Aug 7, 2014 at 5:09 mkomko 22.1k50 gold badges135 silver badges195 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 8

Maintainer of RSVP here, sorry that you ran into this issue.

Firstly, it appears you are using an older version of RSVP. I would recommend upgrading.

Unfortunately it appears this issue may be related to https://github.com/emberjs/ember.js/pull/5629 which appears to just be that JSC for non-64bit devices running iOS 8 is just broken when in 'use strict' mode. In my observations it only happens in specific situations and then only when the code in question has become optimized.

Again I am unsure if upgrading will help you, but you should consider it regardless. Additionally, if the problem persists removing all use strict statements may be the best option.

If no solution appears soon, I will likely publish an update to RSVP with the use strict statements removed.

Have you tried to remove all the "use strict";'s from your code? From my understanding it only seems to occur with 3. generation iPads.

发布评论

评论列表(0)

  1. 暂无评论