Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...